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

Function OperateL3RDoor

Source/objects.cpp:2181–2221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2179}
2180
2181void OperateL3RDoor(int pnum, int oi, BOOL sendflag)
2182{
2183 int xp, yp;
2184
2185 if (object[oi]._oVar4 == 2) {
2186 if (!deltaload)
2187 PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, object[oi]._oy);
2188 return;
2189 }
2190
2191 xp = object[oi]._ox;
2192 yp = object[oi]._oy;
2193 if (object[oi]._oVar4 == 0) {
2194 if (pnum == myplr && sendflag)
2195 NetSendCmdParam1(TRUE, CMD_OPENDOOR, oi);
2196 if (!deltaload)
2197 PlaySfxLoc(IS_DOOROPEN, object[oi]._ox, object[oi]._oy);
2198 ObjSetMicro(xp, yp, 541);
2199 object[oi]._oAnimFrame += 2;
2200 object[oi]._oPreFlag = TRUE;
2201 object[oi]._oVar4 = 1;
2202 object[oi]._oSelFlag = 2;
2203 RedoPlayerVision();
2204 return;
2205 }
2206
2207 if (!deltaload)
2208 PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp);
2209 if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) {
2210 if (pnum == myplr && sendflag)
2211 NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
2212 object[oi]._oVar4 = 0;
2213 object[oi]._oSelFlag = 3;
2214 ObjSetMicro(xp, yp, 534);
2215 object[oi]._oAnimFrame -= 2;
2216 object[oi]._oPreFlag = FALSE;
2217 RedoPlayerVision();
2218 } else {
2219 object[oi]._oVar4 = 2;
2220 }
2221}
2222
2223void OperateL3LDoor(int pnum, int oi, BOOL sendflag)
2224{

Callers 3

MonstCheckDoorsFunction · 0.85
OperateL3DoorFunction · 0.85
OperateObjectFunction · 0.85

Calls 4

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

Tested by

no test coverage detected