Skip to main content

Close a door

SCRIPT_CLOSE_DOOR · opcode 0xfc · 3 bytes

Script virtual machine · Opcode list · Scripted doors

Starts closing the door of a block, unless something stands in the doorway.

Encoding​

Offsets count from the opcode byte. Words are little-endian.

OffsetTypeFieldMeaning
0u8opcode0xfc
1u16leblockBlock that contains the door.

Behavior​

The request is skipped, and the script continues, when either:1

  • the block's occupancy (the LEVEL_BLOCK_OCCUPANCY_MASK bits of LevelBlockStateFlags) is nonzero; or
  • the block is the party's current block.

Otherwise the handler passes the block and the closing direction to the shared door routine described under Open a door.2

Edge cases​

  • The check for occupants is made only when the request is made. From its first step, a fully open door no longer lets the party or monsters through.
  • Timing and the no-slot case are described under scripted doors.
  • On a block without a door, see the anomaly of the shared routine.

Sources​

Footnotes​

  1. Handler for 0xfc and the guarded close wrapper. Comparative source: oeob_closeDoor in REF-SCUMM-003. ↩

  2. Shared door routine. ↩