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

Function OperateL1RDoor

Source/objects.cpp:1990–2041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1988}
1989
1990void OperateL1RDoor(int pnum, int oi, BOOL sendflag)
1991{
1992 int xp, yp;
1993
1994 if (object[oi]._oVar4 == 2) {
1995 if (!deltaload)
1996 PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, object[oi]._oy);
1997 return;
1998 }
1999
2000 xp = object[oi]._ox;
2001 yp = object[oi]._oy;
2002 if (object[oi]._oVar4 == 0) {
2003 if (pnum == myplr && sendflag)
2004 NetSendCmdParam1(TRUE, CMD_OPENDOOR, oi);
2005 if (!deltaload)
2006 PlaySfxLoc(IS_DOOROPEN, object[oi]._ox, object[oi]._oy);
2007 ObjSetMicro(xp, yp, 395);
2008 dArch[xp][yp] = 8;
2009 objects_set_door_piece(xp, yp - 1);
2010 object[oi]._oAnimFrame += 2;
2011 object[oi]._oPreFlag = TRUE;
2012 DoorSet(oi, xp - 1, yp);
2013 object[oi]._oVar4 = 1;
2014 object[oi]._oSelFlag = 2;
2015 RedoPlayerVision();
2016 return;
2017 }
2018
2019 if (!deltaload)
2020 PlaySfxLoc(IS_DOORCLOS, xp, object[oi]._oy);
2021 if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) {
2022 if (pnum == myplr && sendflag)
2023 NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
2024 object[oi]._oVar4 = 0;
2025 object[oi]._oSelFlag = 3;
2026 ObjSetMicro(xp, yp, object[oi]._oVar1);
2027 if (object[oi]._oVar2 != 50) {
2028 ObjSetMicro(xp - 1, yp, object[oi]._oVar2);
2029 } else {
2030 if (dPiece[xp - 1][yp] == 396)
2031 ObjSetMicro(xp - 1, yp, 411);
2032 else
2033 ObjSetMicro(xp - 1, yp, 50);
2034 }
2035 object[oi]._oAnimFrame -= 2;
2036 object[oi]._oPreFlag = FALSE;
2037 RedoPlayerVision();
2038 } else {
2039 object[oi]._oVar4 = 2;
2040 }
2041}
2042
2043void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
2044{

Callers 4

MonstCheckDoorsFunction · 0.85
OperateL1DoorFunction · 0.85
OperateObjectFunction · 0.85
SyncOpL1DoorFunction · 0.85

Calls 6

PlaySfxLocFunction · 0.85
NetSendCmdParam1Function · 0.85
ObjSetMicroFunction · 0.85
objects_set_door_pieceFunction · 0.85
DoorSetFunction · 0.85
RedoPlayerVisionFunction · 0.85

Tested by

no test coverage detected