Browse Source

Clean up Obj_Trap

pull/25/head
Anders Jenbo 7 years ago
parent
commit
492125a67c
  1. 119
      Source/objects.cpp

119
Source/objects.cpp

@ -2383,86 +2383,55 @@ void __fastcall Obj_FlameTrap(int i)
void __fastcall Obj_Trap(int i) void __fastcall Obj_Trap(int i)
{ {
int edi1; // edi int oti, dir;
int v2; // esi BOOL otrig;
int v3; // eax int sx, sy, dx, dy, x, y;
int v4; // eax
int v5; // ebx otrig = FALSE;
int v6; // ecx if (!object[i]._oVar4) {
int v7; // eax oti = dObject[object[i]._oVar1][object[i]._oVar2] - 1;
int v8; // ecx switch (object[oti]._otype) {
char *j; // edx case OBJ_L1LDOOR:
int v10; // eax case OBJ_L1RDOOR:
int v11; // [esp+8h] [ebp-1Ch] case OBJ_L2LDOOR:
int v12; // [esp+10h] [ebp-14h] case OBJ_L2RDOOR:
int sx; // [esp+14h] [ebp-10h] case OBJ_L3LDOOR:
int sy; // [esp+18h] [ebp-Ch] case OBJ_L3RDOOR:
int v15; // [esp+1Ch] [ebp-8h] if (object[oti]._oVar4)
int v1; // [esp+20h] [ebp-4h] otrig = TRUE;
break;
edi1 = i; case OBJ_LEVER:
if (object[i]._oVar4) case OBJ_CHEST1:
return; case OBJ_CHEST2:
v2 = dObject[object[edi1]._oVar1][object[edi1]._oVar2] - 1; case OBJ_CHEST3:
v3 = object[v2]._otype; case OBJ_SWITCHSKL:
if (v3 <= OBJ_L2RDOOR) { case OBJ_SARC:
if (v3 < OBJ_L2LDOOR) { if (!object[oti]._oSelFlag)
if (v3 <= 0) otrig = TRUE;
return; break;
if (v3 > OBJ_L1RDOOR) {
if (v3 <= OBJ_SKFIRE || v3 > OBJ_CHEST3 && v3 != OBJ_SWITCHSKL)
return;
goto LABEL_9;
}
} }
LABEL_17: if (otrig) {
if (!object[v2]._oVar4) object[i]._oVar4 = 1;
return; sx = object[i]._ox;
goto LABEL_10; sy = object[i]._oy;
} dx = object[oti]._ox;
if (v3 != OBJ_SARC) { dy = object[oti]._oy;
if (v3 <= OBJ_PEDISTAL || v3 > OBJ_L3RDOOR) for (y = dy - 1; y <= object[oti]._oy + 1; y++) {
return; for (x = object[oti]._ox - 1; x <= object[oti]._ox + 1; x++) {
goto LABEL_17; if (dPlayer[x][y]) {
} dx = x;
LABEL_9: dy = y;
if (object[v2]._oSelFlag)
return;
LABEL_10:
v4 = object[edi1]._ox;
object[edi1]._oVar4 = 1;
v5 = object[v2]._oy;
v6 = object[v2]._ox;
sx = v4;
sy = object[edi1]._oy;
v7 = v5 - 1;
v1 = object[v2]._ox;
v11 = v5 + 1;
if ((unsigned char)(__OFSUB__(v5 - 1, v5 + 1) ^ 1) | (v5 - 1 == v5 + 1)) {
v12 = v6 - 1;
v15 = v6 + 1;
do {
v8 = v12;
if (v12 <= v15) {
for (j = &dPlayer[v12][v7];; j += 112) {
if (*j) {
v1 = v8;
v5 = v7;
} }
if (++v8 > v15)
break;
} }
} }
++v7; if (!deltaload) {
} while (v7 <= v11); dir = GetDirection(sx, sy, dx, dy);
v6 = v1; AddMissile(sx, sy, dx, dy, dir, object[i]._oVar3, 1, -1, 0, 0);
} PlaySfxLoc(IS_TRAP, object[oti]._ox, object[oti]._oy);
if (!deltaload) { }
v10 = GetDirection(sx, sy, v6, v5); object[oti]._oTrapFlag = 0;
AddMissile(sx, sy, v1, v5, v10, object[edi1]._oVar3, 1, -1, 0, 0); }
PlaySfxLoc(IS_TRAP, object[v2]._ox, object[v2]._oy);
} }
object[v2]._oTrapFlag = 0;
} }
// 676190: using guessed type int deltaload; // 676190: using guessed type int deltaload;

Loading…
Cancel
Save