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.
| Offset | Type | Field | Meaning |
|---|---|---|---|
| 0 | u8 | opcode | 0xfc |
| 1 | u16le | block | Block that contains the door. |
Behavior
The request is skipped, and the script continues, when either:1
- the block's occupancy (the
LEVEL_BLOCK_OCCUPANCY_MASKbits ofLevelBlockStateFlags) 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.