mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 12:30:40 +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)
|
bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
||||||
{
|
{
|
||||||
uint8_t switchpal;
|
uint8_t switchpal;
|
||||||
int i, x, lotag, hitag, picnum, correctdips, numdips;
|
int lotag, hitag, picnum, correctdips, numdips;
|
||||||
int sx, sy;
|
int sx, sy;
|
||||||
|
walltype* wwal = nullptr;
|
||||||
|
|
||||||
if (ww < 0 && act == nullptr) return 0;
|
if (ww < 0 && act == nullptr) return 0;
|
||||||
correctdips = 1;
|
correctdips = 1;
|
||||||
|
@ -244,14 +245,14 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto wal = &wall[ww];
|
wwal = &wall[ww];
|
||||||
lotag = wal->lotag;
|
lotag = wwal->lotag;
|
||||||
if (lotag == 0) return 0;
|
if (lotag == 0) return 0;
|
||||||
hitag = wal->hitag;
|
hitag = wwal->hitag;
|
||||||
sx = wal->x;
|
sx = wwal->x;
|
||||||
sy = wal->y;
|
sy = wwal->y;
|
||||||
picnum = wal->picnum;
|
picnum = wwal->picnum;
|
||||||
switchpal = wal->pal;
|
switchpal = wwal->pal;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (picnum)
|
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 == wal.lotag)
|
||||||
if (lotag == wall[x].lotag)
|
switch (wal.picnum)
|
||||||
switch (wall[x].picnum)
|
|
||||||
{
|
{
|
||||||
case DIPSWITCH:
|
case DIPSWITCH:
|
||||||
case TECHSWITCH:
|
case TECHSWITCH:
|
||||||
case ALIENSWITCH:
|
case ALIENSWITCH:
|
||||||
if (!act && i == ww) wall[x].picnum++;
|
if (!act && &wal == wwal) wal.picnum++;
|
||||||
else if (wall[x].hitag == 0) correctdips++;
|
else if (wal.hitag == 0) correctdips++;
|
||||||
numdips++;
|
numdips++;
|
||||||
break;
|
break;
|
||||||
case DIPSWITCH + 1:
|
case DIPSWITCH + 1:
|
||||||
case TECHSWITCH + 1:
|
case TECHSWITCH + 1:
|
||||||
case ALIENSWITCH + 1:
|
case ALIENSWITCH + 1:
|
||||||
if (!act && i == ww) wall[x].picnum--;
|
if (!act && &wal == wwal) wal.picnum--;
|
||||||
else if (wall[x].hitag == 1) correctdips++;
|
else if (wal.hitag == 1) correctdips++;
|
||||||
numdips++;
|
numdips++;
|
||||||
break;
|
break;
|
||||||
case MULTISWITCH:
|
case MULTISWITCH:
|
||||||
case MULTISWITCH + 1:
|
case MULTISWITCH + 1:
|
||||||
case MULTISWITCH + 2:
|
case MULTISWITCH + 2:
|
||||||
case MULTISWITCH + 3:
|
case MULTISWITCH + 3:
|
||||||
wall[x].picnum++;
|
wal.picnum++;
|
||||||
if (wall[x].picnum > (MULTISWITCH + 3))
|
if (wal.picnum > (MULTISWITCH + 3))
|
||||||
wall[x].picnum = MULTISWITCH;
|
wal.picnum = MULTISWITCH;
|
||||||
break;
|
break;
|
||||||
case ACCESSSWITCH:
|
case ACCESSSWITCH:
|
||||||
case ACCESSSWITCH2:
|
case ACCESSSWITCH2:
|
||||||
|
@ -457,7 +457,7 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
||||||
case HANDSWITCH:
|
case HANDSWITCH:
|
||||||
case DIPSWITCH2:
|
case DIPSWITCH2:
|
||||||
case DIPSWITCH3:
|
case DIPSWITCH3:
|
||||||
wall[x].picnum++;
|
wal.picnum++;
|
||||||
break;
|
break;
|
||||||
case HANDSWITCH + 1:
|
case HANDSWITCH + 1:
|
||||||
case PULLSWITCH + 1:
|
case PULLSWITCH + 1:
|
||||||
|
@ -471,7 +471,7 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
|
||||||
case SPACEDOORSWITCH + 1:
|
case SPACEDOORSWITCH + 1:
|
||||||
case DIPSWITCH2 + 1:
|
case DIPSWITCH2 + 1:
|
||||||
case DIPSWITCH3 + 1:
|
case DIPSWITCH3 + 1:
|
||||||
wall[x].picnum--;
|
wal.picnum--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue