Manual:DIL Manual/switched
Jump to navigation
Jump to search
Contents
switched
Field (unitptr, read-only; units: characters).
ch.switched : unitptr
Who is controlled through a switch:
- On a player who has switched into an NPC: the NPC the player now controls.
- On an NPC that a player has switched into: the NPC itself, not the player. So
npc.switched != nulltells that a player is in it. - Otherwise null: a player who hasn't switched, a link-dead player, an NPC no one controls.
Notes
- On an object or a room it is null; on null it fails.
- It can't be assigned (vmc: "Illegal lvalue").
Example
dilbegin integer has_player(u : unitptr);
code
{
if (u.type == UNIT_ST_PC)
return (TRUE);
if ((u.type == UNIT_ST_NPC) and (u.switched != null))
return (TRUE);
return (FALSE);
}
dilend
Tells whether a player sees through this character, as look checks in baselook.zon.