- spawneffectors

This commit is contained in:
Christoph Oelckers 2021-11-17 23:31:08 +01:00
parent cccc577c2e
commit 94d0e9775f
2 changed files with 19 additions and 39 deletions

View file

@ -959,7 +959,7 @@ static void handle_st28(int sn, DDukeActor* actor)
void operatesectors(int sn, DDukeActor *actor)
{
int j=0, startwall, endwall;
int j=0;
int i;
sectortype* sptr;
@ -1191,8 +1191,6 @@ void operatemasterswitches(int low)
void operateforcefields_common(DDukeActor *effector, int low, const std::initializer_list<int> &tiles)
{
int p;
for (int p = numanimwalls; p >= 0; p--)
{
auto wal = &wall[animwall[p].wallnum];

View file

@ -846,15 +846,12 @@ void spawneffector(DDukeActor* actor)
//fix all the walls;
startwall = sectp->wallptr;
endwall = startwall + sectp->wallnum;
for (s = startwall; s < endwall; s++)
for (auto& wal : wallsofsector(sectp))
{
if (!(wall[s].hitag & 1))
wall[s].shade = sp->shade;
if ((wall[s].cstat & 2) && wall[s].nextwall >= 0)
wall[wall[s].nextwall].shade = sp->shade;
if (!(wal.hitag & 1))
wal.shade = sp->shade;
if ((wal.cstat & 2) && wal.nextwall >= 0)
wal.nextWall()->shade = sp->shade;
}
break;
@ -863,11 +860,8 @@ void spawneffector(DDukeActor* actor)
// t[2] = sp->hitag;
if (sp->ang != 1536) sectp->floorz = sp->z;
startwall = sectp->wallptr;
endwall = startwall + sectp->wallnum;
for (s = startwall; s < endwall; s++)
if (wall[s].hitag == 0) wall[s].hitag = 9999;
for (auto& wal : wallsofsector(sectp))
if (wal.hitag == 0) wal.hitag = 9999;
StartInterpolation(sect, Interp_Sect_Floorz);
@ -877,11 +871,8 @@ void spawneffector(DDukeActor* actor)
t[2] = sp->hitag;
if (sp->ang != 1536) sectp->ceilingz = sp->z;
startwall = sectp->wallptr;
endwall = startwall + sectp->wallnum;
for (s = startwall; s < endwall; s++)
if (wall[s].hitag == 0) wall[s].hitag = 9999;
for (auto& wal : wallsofsector(sectp))
if (wal.hitag == 0) wal.hitag = 9999;
StartInterpolation(sect, Interp_Sect_Ceilingz);
@ -891,14 +882,11 @@ void spawneffector(DDukeActor* actor)
t[2] = sectp->floorshade;
startwall = sectp->wallptr;
endwall = startwall + sectp->wallnum;
actor->palvals = (sectp->ceilingpal << 8) | sectp->floorpal;
for (s = startwall; s < endwall; s++)
if (wall[s].shade > t[3])
t[3] = wall[s].shade;
for (auto& wal : wallsofsector(sectp))
if (wal.shade > t[3])
t[3] = wal.shade;
break;
@ -913,12 +901,9 @@ void spawneffector(DDukeActor* actor)
t[0] = sectp->floorshade;
t[1] = sectp->ceilingshade;
startwall = sectp->wallptr;
endwall = startwall + sectp->wallnum;
for (s = startwall; s < endwall; s++)
if (wall[s].shade > t[2])
t[2] = wall[s].shade;
for (auto& wal : wallsofsector(sectp))
if (wal.shade > t[2])
t[2] = wal.shade;
t[3] = 1; //Take Out;
@ -931,12 +916,9 @@ void spawneffector(DDukeActor* actor)
t[0] = sectp->floorshade;
t[1] = sectp->ceilingshade;
startwall = sectp->wallptr;
endwall = startwall + sectp->wallnum;
for (s = startwall; s < endwall; s++)
if (wall[s].shade > t[2])
t[2] = wall[s].shade;
for (auto& wal : wallsofsector(sectp))
if (wal.shade > t[2])
t[2] = wal.shade;
t[3] = 1; //Take Out;
break;