- Duke/RR: sector[] replacement in spawn code.

This commit is contained in:
Christoph Oelckers 2021-11-07 00:19:13 +01:00
parent ca5a014a2d
commit 5eed73f7af
2 changed files with 13 additions and 11 deletions

View file

@ -54,6 +54,7 @@ int spawn_d(int j, int pn)
auto spj = j < 0 ? nullptr : actj->s;
auto t = act->temp_data;
int sect = sp->sectnum;
auto sectp = sp->sector();
if (isWorldTour())
@ -175,8 +176,8 @@ int spawn_d(int j, int pn)
sp->z = getflorzofslope(sp->sectnum,sp->x,sp->y);
}
if(sector[sect].floorpicnum == FLOORSLIME ||
sector[sect].ceilingpicnum == FLOORSLIME)
if(sectp->floorpicnum == FLOORSLIME ||
sectp->ceilingpicnum == FLOORSLIME)
sp->pal = 7;
case NEON1:
case NEON2:
@ -711,9 +712,9 @@ int spawn_d(int j, int pn)
changespritestat(i,6);
break;
case TOUCHPLATE:
t[2] = sector[sect].floorz;
if(sector[sect].lotag != 1 && sector[sect].lotag != 2)
sector[sect].floorz = sp->z;
t[2] = sectp->floorz;
if(sectp->lotag != 1 && sectp->lotag != 2)
sectp->floorz = sp->z;
if (!isWorldTour())
{
if (sp->pal && ud.multimode > 1)

View file

@ -49,6 +49,7 @@ int spawn_r(int j, int pn)
auto spj = j < 0? nullptr : actj->s;
auto t = act->temp_data;
int sect = sp->sectnum;
auto sectp = sp->sector();
switch(sp->picnum)
{
@ -230,8 +231,8 @@ int spawn_r(int j, int pn)
sp->z = getflorzofslope(sp->sectnum, sp->x, sp->y);
}
if(sector[sect].floorpicnum == FLOORSLIME ||
sector[sect].ceilingpicnum == FLOORSLIME)
if(sectp->floorpicnum == FLOORSLIME ||
sectp->ceilingpicnum == FLOORSLIME)
sp->pal = 7;
case NEON1:
case NEON2:
@ -718,9 +719,9 @@ int spawn_r(int j, int pn)
changespritestat(i,6);
break;
case TOUCHPLATE:
t[2] = sector[sect].floorz;
if(sector[sect].lotag != 1 && sector[sect].lotag != 2)
sector[sect].floorz = sp->z;
t[2] = sectp->floorz;
if(sectp->lotag != 1 && sectp->lotag != 2)
sectp->floorz = sp->z;
if(sp->pal && ud.multimode > 1)
{
sp->xrepeat=sp->yrepeat=0;
@ -1071,7 +1072,7 @@ int spawn_r(int j, int pn)
// sp->xrepeat=sp->yrepeat=0;
sp->cstat |= 32768;
if (sp->picnum == ACTIVATORLOCKED)
sector[sect].lotag ^= 16384;
sectp->lotag ^= 16384;
changeactorstat(act, STAT_ACTIVATOR);
break;
case DOORSHOCK: