From 82bbef8ab7de7a328d38bc6374ff3685e296a207 Mon Sep 17 00:00:00 2001 From: Sergey Semushin Date: Wed, 24 Apr 2019 22:29:00 +0300 Subject: [PATCH] Stylistic changes for OperateL1RDoor. --- Source/objects.cpp | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Source/objects.cpp b/Source/objects.cpp index 555971485..5de7ff8e5 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -2352,7 +2352,7 @@ void RedoPlayerVision() void OperateL1RDoor(int pnum, int oi, BOOL sendflag) { - int xp, yp, pn; + int xp, yp; if (object[oi]._oVar4 == 2) { if (!deltaload) @@ -2376,30 +2376,30 @@ void OperateL1RDoor(int pnum, int oi, BOOL sendflag) object[oi]._oVar4 = 1; object[oi]._oSelFlag = 2; RedoPlayerVision(); - } else { - if (!deltaload) - PlaySfxLoc(IS_DOORCLOS, xp, object[oi]._oy); - if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) { - if (pnum == myplr && sendflag) - NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi); - pn = object[oi]._oVar1; - object[oi]._oVar4 = 0; - object[oi]._oSelFlag = 3; - ObjSetMicro(xp, yp, pn); - if (object[oi]._oVar2 != 50) { - ObjSetMicro(xp - 1, yp, object[oi]._oVar2); - } else { - if (dPiece[xp - 1][yp] == 396) - ObjSetMicro(xp - 1, yp, 411); - else - ObjSetMicro(xp - 1, yp, 50); - } - object[oi]._oAnimFrame -= 2; - object[oi]._oPreFlag = FALSE; - RedoPlayerVision(); + return; + } + + if (!deltaload) + PlaySfxLoc(IS_DOORCLOS, xp, object[oi]._oy); + if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) { + if (pnum == myplr && sendflag) + NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi); + object[oi]._oVar4 = 0; + object[oi]._oSelFlag = 3; + ObjSetMicro(xp, yp, object[oi]._oVar1); + if (object[oi]._oVar2 != 50) { + ObjSetMicro(xp - 1, yp, object[oi]._oVar2); } else { - object[oi]._oVar4 = 2; + if (dPiece[xp - 1][yp] == 396) + ObjSetMicro(xp - 1, yp, 411); + else + ObjSetMicro(xp - 1, yp, 50); } + object[oi]._oAnimFrame -= 2; + object[oi]._oPreFlag = FALSE; + RedoPlayerVision(); + } else { + object[oi]._oVar4 = 2; } } // 676190: using guessed type int deltaload;