<?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%2Fswitched</id>
	<title>Manual:DIL Manual/switched - 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%2Fswitched"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/switched&amp;action=history"/>
	<updated>2026-11-22T19:51:50Z</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/switched&amp;diff=2811&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/switched&amp;diff=2811&amp;oldid=prev"/>
		<updated>2026-11-14T22:59:59Z</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;= switched =&lt;br /&gt;
'''Field''' (unitptr, read-only; units: characters).&lt;br /&gt;
&lt;br /&gt;
 ch.switched : unitptr&lt;br /&gt;
&lt;br /&gt;
Who is controlled through a &amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt;:&lt;br /&gt;
* On a player who has switched into an NPC: the NPC the player now controls.&lt;br /&gt;
* On an NPC that a player has switched into: the NPC itself, not the player. So &amp;lt;code&amp;gt;npc.switched != null&amp;lt;/code&amp;gt; tells that a player is in it.&lt;br /&gt;
* Otherwise null: a player who hasn't switched, a link-dead player, an NPC no one controls.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* On an object or a room it is null; on null it fails.&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer has_player(u : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (u.type == UNIT_ST_PC)&lt;br /&gt;
      return (TRUE);&lt;br /&gt;
   if ((u.type == UNIT_ST_NPC) and (u.switched != null))&lt;br /&gt;
      return (TRUE);&lt;br /&gt;
   return (FALSE);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells whether a player sees through this character, as &amp;lt;code&amp;gt;look&amp;lt;/code&amp;gt; checks in baselook.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/isplayer()|isplayer()]]&lt;br /&gt;
* [[Manual:DIL Manual/type|type]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>