MCPcopy Create free account
hub / github.com/diasurgical/devilution / OperateL2LDoor

Function OperateL2LDoor

Source/objects.cpp:2140–2179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2138}
2139
2140void OperateL2LDoor(int pnum, int oi, BOOL sendflag)
2141{
2142 int xp, yp;
2143
2144 if (object[oi]._oVar4 == 2) {
2145 if (!deltaload)
2146 PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, object[oi]._oy);
2147 return;
2148 }
2149 xp = object[oi]._ox;
2150 yp = object[oi]._oy;
2151 if (object[oi]._oVar4 == 0) {
2152 if (pnum == myplr && sendflag)
2153 NetSendCmdParam1(TRUE, CMD_OPENDOOR, oi);
2154 if (!deltaload)
2155 PlaySfxLoc(IS_DOOROPEN, object[oi]._ox, object[oi]._oy);
2156 ObjSetMicro(xp, yp, 13);
2157 object[oi]._oAnimFrame += 2;
2158 object[oi]._oPreFlag = TRUE;
2159 object[oi]._oVar4 = 1;
2160 object[oi]._oSelFlag = 2;
2161 RedoPlayerVision();
2162 return;
2163 }
2164
2165 if (!deltaload)
2166 PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp);
2167 if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) {
2168 if (pnum == myplr && sendflag)
2169 NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
2170 object[oi]._oVar4 = 0;
2171 object[oi]._oSelFlag = 3;
2172 ObjSetMicro(xp, yp, 538);
2173 object[oi]._oAnimFrame -= 2;
2174 object[oi]._oPreFlag = FALSE;
2175 RedoPlayerVision();
2176 } else {
2177 object[oi]._oVar4 = 2;
2178 }
2179}
2180
2181void OperateL3RDoor(int pnum, int oi, BOOL sendflag)
2182{

Callers 5

MonstCheckDoorsFunction · 0.85
OperateL2DoorFunction · 0.85
OperateObjectFunction · 0.85
SyncOpL2DoorFunction · 0.85
SyncOpL3DoorFunction · 0.85

Calls 4

PlaySfxLocFunction · 0.85
NetSendCmdParam1Function · 0.85
ObjSetMicroFunction · 0.85
RedoPlayerVisionFunction · 0.85

Tested by

no test coverage detected