Manual:DIL Manual/global head()

From DikuMUD Wiki
Jump to navigation Jump to search

global_head()

Function (unitptr). Another name for ghead(): the first unit in the game's global unit list.

global_head()

Exactly the same as ghead(): vmc compiles both to the same call. The global list holds every unit in the game, kept in this order: all players (the one who entered the game last first), then all NPCs, then all objects, then all rooms. Each unit's gnext is the next one in the list, and null after the last room. global_head() returns the first unit: the player who entered the game last, or the first NPC when no players are on.

Returns

Unitptr: the first unit of the list.

Notes

  • The public zones use ghead() or pc_head(); see ghead() for how to walk the list.

Example

dilbegin unitptr newest_unit();
var
   u : unitptr;
code
{
   u := global_head();
   return (u);
}
dilend

Returns the first unit of the global list.

See also