Manual:DIL Manual/exit info

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:12, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

exit_info

Field (integer, read/write; units: rooms).

rm.exit_info[dir] : integer

The flags of the exit in direction dir (NORTH, EAST, ... SOUTHWEST, 0 to MAX_EXIT): whether it has a door and what state it is in. It is the exit's open line in the zone file. The flags, in vme.h: EX_OPEN_CLOSE (there is a door), EX_CLOSED, EX_LOCKED, EX_PICKPROOF, EX_INSIDE_OPEN, EX_HIDDEN (found only by searching), EX_CLIMB (must be climbed) and EX_FALL_THIS_WAY. Test and change them with isset(), set() and unset().

Notes

  • The other side of a door is a separate exit with its own flags: closing one side leaves the other open unless you change it too, as the example does.
  • Changing the flags sends no message; act() what players should see.
  • Stored as 8 bits.
  • Rooms only. On another unit or null, with a direction out of range, or where the room has no exit that way, it fails.

Example

dilbegin close_door(rm : unitptr, dir : integer);
var
   other : unitptr;
   i : integer;
code
{
   if (rm.exit_to[dir] == null)
      return;
   if (not isset(rm.exit_info[dir], EX_OPEN_CLOSE))
      return;
   set(rm.exit_info[dir], EX_CLOSED);

   other := rm.exit_to[dir];
   i := 0;
   while (i <= MAX_EXIT)
   {
      if (other.exit_to[i] == rm)
      {
         set(other.exit_info[i], EX_CLOSED);
         break;
      }
      i := i + 1;
   }
   return;
}
dilend

Closes a door from both sides, as close does in basemove.zon.

See also