mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- checkhitswitch_d
This commit is contained in:
parent
8cf3963901
commit
7268e779a7
1 changed files with 21 additions and 21 deletions
|
@ -225,8 +225,9 @@ void operateforcefields_d(DDukeActor* act, int low)
|
|||
bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
||||
{
|
||||
uint8_t switchpal;
|
||||
int i, x, lotag, hitag, picnum, correctdips, numdips;
|
||||
int lotag, hitag, picnum, correctdips, numdips;
|
||||
int sx, sy;
|
||||
walltype* wwal = nullptr;
|
||||
|
||||
if (ww < 0 && act == nullptr) return 0;
|
||||
correctdips = 1;
|
||||
|
@ -244,14 +245,14 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
|||
}
|
||||
else
|
||||
{
|
||||
auto wal = &wall[ww];
|
||||
lotag = wal->lotag;
|
||||
wwal = &wall[ww];
|
||||
lotag = wwal->lotag;
|
||||
if (lotag == 0) return 0;
|
||||
hitag = wal->hitag;
|
||||
sx = wal->x;
|
||||
sy = wal->y;
|
||||
picnum = wal->picnum;
|
||||
switchpal = wal->pal;
|
||||
hitag = wwal->hitag;
|
||||
sx = wwal->x;
|
||||
sy = wwal->y;
|
||||
picnum = wwal->picnum;
|
||||
switchpal = wwal->pal;
|
||||
}
|
||||
|
||||
switch (picnum)
|
||||
|
@ -415,33 +416,32 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < numwalls; i++)
|
||||
for (auto& wal : walls())
|
||||
{
|
||||
x = i;
|
||||
if (lotag == wall[x].lotag)
|
||||
switch (wall[x].picnum)
|
||||
if (lotag == wal.lotag)
|
||||
switch (wal.picnum)
|
||||
{
|
||||
case DIPSWITCH:
|
||||
case TECHSWITCH:
|
||||
case ALIENSWITCH:
|
||||
if (!act && i == ww) wall[x].picnum++;
|
||||
else if (wall[x].hitag == 0) correctdips++;
|
||||
if (!act && &wal == wwal) wal.picnum++;
|
||||
else if (wal.hitag == 0) correctdips++;
|
||||
numdips++;
|
||||
break;
|
||||
case DIPSWITCH + 1:
|
||||
case TECHSWITCH + 1:
|
||||
case ALIENSWITCH + 1:
|
||||
if (!act && i == ww) wall[x].picnum--;
|
||||
else if (wall[x].hitag == 1) correctdips++;
|
||||
if (!act && &wal == wwal) wal.picnum--;
|
||||
else if (wal.hitag == 1) correctdips++;
|
||||
numdips++;
|
||||
break;
|
||||
case MULTISWITCH:
|
||||
case MULTISWITCH + 1:
|
||||
case MULTISWITCH + 2:
|
||||
case MULTISWITCH + 3:
|
||||
wall[x].picnum++;
|
||||
if (wall[x].picnum > (MULTISWITCH + 3))
|
||||
wall[x].picnum = MULTISWITCH;
|
||||
wal.picnum++;
|
||||
if (wal.picnum > (MULTISWITCH + 3))
|
||||
wal.picnum = MULTISWITCH;
|
||||
break;
|
||||
case ACCESSSWITCH:
|
||||
case ACCESSSWITCH2:
|
||||
|
@ -457,7 +457,7 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
|||
case HANDSWITCH:
|
||||
case DIPSWITCH2:
|
||||
case DIPSWITCH3:
|
||||
wall[x].picnum++;
|
||||
wal.picnum++;
|
||||
break;
|
||||
case HANDSWITCH + 1:
|
||||
case PULLSWITCH + 1:
|
||||
|
@ -471,7 +471,7 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
|||
case SPACEDOORSWITCH + 1:
|
||||
case DIPSWITCH2 + 1:
|
||||
case DIPSWITCH3 + 1:
|
||||
wall[x].picnum--;
|
||||
wal.picnum--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue