MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / OperateDoor

Function OperateDoor

Source/objects.cpp:1862–1885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1860}
1861
1862void OperateDoor(Object &door, bool sendflag)
1863{
1864 bool isCrypt = IsAnyOf(door._otype, OBJ_L5LDOOR, OBJ_L5RDOOR);
1865 bool openDoor = door._oVar4 == DOOR_CLOSED;
1866
1867 if (!openDoor && !IsDoorClear(door)) {
1868 PlaySfxLoc(isCrypt ? IS_CRCLOS : IS_DOORCLOS, door.position);
1869 door._oVar4 = DOOR_BLOCKED;
1870 return;
1871 }
1872
1873 if (openDoor) {
1874 PlaySfxLoc(isCrypt ? IS_CROPEN : IS_DOOROPEN, door.position);
1875 OpenDoor(door);
1876 } else {
1877 PlaySfxLoc(isCrypt ? IS_CRCLOS : IS_DOORCLOS, door.position);
1878 CloseDoor(door);
1879 }
1880
1881 RedoPlayerVision();
1882
1883 if (sendflag)
1884 NetSendCmdLoc(MyPlayerId, true, openDoor ? CMD_OPENDOOR : CMD_CLOSEDOOR, door.position);
1885}
1886
1887bool AreAllLeversActivated(int leverId)
1888{

Callers 3

MonstCheckDoorsFunction · 0.85
OperateObjectFunction · 0.85
SyncOpObjectFunction · 0.85

Calls 7

IsAnyOfFunction · 0.85
IsDoorClearFunction · 0.85
OpenDoorFunction · 0.85
CloseDoorFunction · 0.85
RedoPlayerVisionFunction · 0.85
NetSendCmdLocFunction · 0.85
PlaySfxLocFunction · 0.70

Tested by

no test coverage detected