<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fglobal_head%28%29</id>
	<title>Manual:DIL Manual/global head() - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fglobal_head%28%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/global_head()&amp;action=history"/>
	<updated>2026-11-24T04:53:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/global_head()&amp;diff=2964&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/global_head()&amp;diff=2964&amp;oldid=prev"/>
		<updated>2026-11-14T23:15:26Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= global_head() =&lt;br /&gt;
'''Function''' (unitptr). Another name for &amp;lt;code&amp;gt;ghead()&amp;lt;/code&amp;gt;: the first unit in the game's global unit list.&lt;br /&gt;
&lt;br /&gt;
 global_head()&lt;br /&gt;
&lt;br /&gt;
Exactly the same as [[Manual:DIL Manual/ghead()|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 &amp;lt;code&amp;gt;gnext&amp;lt;/code&amp;gt; is the next one in the list, and null after the last room. &amp;lt;code&amp;gt;global_head()&amp;lt;/code&amp;gt; returns the first unit: the player who entered the game last, or the first NPC when no players are on.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Unitptr: the first unit of the list.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The public zones use &amp;lt;code&amp;gt;ghead()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;pc_head()&amp;lt;/code&amp;gt;; see [[Manual:DIL Manual/ghead()|ghead()]] for how to walk the list.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin unitptr newest_unit();&lt;br /&gt;
var&lt;br /&gt;
   u : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   u := global_head();&lt;br /&gt;
   return (u);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Returns the first unit of the global list.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/ghead()|ghead()]]&lt;br /&gt;
* [[Manual:DIL Manual/pc head()|pc_head()]]&lt;br /&gt;
* [[Manual:DIL Manual/gnext|gnext]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>