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

Function OperateL3LDoor

Source/objects.cpp:2223–2263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2221}
2222
2223void OperateL3LDoor(int pnum, int oi, BOOL sendflag)
2224{
2225 int xp, yp;
2226
2227 if (object[oi]._oVar4 == 2) {
2228 if (!deltaload)
2229 PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, object[oi]._oy);
2230 return;
2231 }
2232
2233 xp = object[oi]._ox;
2234 yp = object[oi]._oy;
2235 if (object[oi]._oVar4 == 0) {
2236 if (pnum == myplr && sendflag)
2237 NetSendCmdParam1(TRUE, CMD_OPENDOOR, oi);
2238 if (!deltaload)
2239 PlaySfxLoc(IS_DOOROPEN, object[oi]._ox, object[oi]._oy);
2240 ObjSetMicro(xp, yp, 538);
2241 object[oi]._oAnimFrame += 2;
2242 object[oi]._oPreFlag = TRUE;
2243 object[oi]._oVar4 = 1;
2244 object[oi]._oSelFlag = 2;
2245 RedoPlayerVision();
2246 return;
2247 }
2248
2249 if (!deltaload)
2250 PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp);
2251 if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) {
2252 if (pnum == myplr && sendflag)
2253 NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
2254 object[oi]._oVar4 = 0;
2255 object[oi]._oSelFlag = 3;
2256 ObjSetMicro(xp, yp, 531);
2257 object[oi]._oAnimFrame -= 2;
2258 object[oi]._oPreFlag = FALSE;
2259 RedoPlayerVision();
2260 } else {
2261 object[oi]._oVar4 = 2;
2262 }
2263}
2264
2265void MonstCheckDoors(int m)
2266{

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