- SW: automatic ->sector() replacements (lots of them)

This commit is contained in:
Christoph Oelckers 2021-11-19 22:03:18 +01:00
parent 5b87370b5e
commit 4266edfa04
21 changed files with 204 additions and 204 deletions

View file

@ -109,21 +109,21 @@ void FAF_DrawRooms(int x, int y, int z, fixed_t q16ang, fixed_t q16horiz, short
if (SP_TAG3(sp) == 0)
{
// back up ceilingpicnum and ceilingstat
SP_TAG5(sp) = sector[sp->sectnum].ceilingpicnum;
sector[sp->sectnum].ceilingpicnum = SP_TAG2(sp);
SP_TAG4(sp) = sector[sp->sectnum].ceilingstat;
SP_TAG5(sp) = sp->sector()->ceilingpicnum;
sp->sector()->ceilingpicnum = SP_TAG2(sp);
SP_TAG4(sp) = sp->sector()->ceilingstat;
//SET(sp->sectnum].ceilingstat, ((int)SP_TAG7(sp))<<7);
SET(sector[sp->sectnum].ceilingstat, SP_TAG6(sp));
RESET(sector[sp->sectnum].ceilingstat, CEILING_STAT_PLAX);
SET(sp->sector()->ceilingstat, SP_TAG6(sp));
RESET(sp->sector()->ceilingstat, CEILING_STAT_PLAX);
}
else if (SP_TAG3(sp) == 1)
{
SP_TAG5(sp) = sector[sp->sectnum].floorpicnum;
sector[sp->sectnum].floorpicnum = SP_TAG2(sp);
SP_TAG4(sp) = sector[sp->sectnum].floorstat;
//SET(sector[sp->sectnum].floorstat, ((int)SP_TAG7(sp))<<7);
SET(sector[sp->sectnum].floorstat, SP_TAG6(sp));
RESET(sector[sp->sectnum].floorstat, FLOOR_STAT_PLAX);
SP_TAG5(sp) = sp->sector()->floorpicnum;
sp->sector()->floorpicnum = SP_TAG2(sp);
SP_TAG4(sp) = sp->sector()->floorstat;
//SET(sp->sector()->floorstat, ((int)SP_TAG7(sp))<<7);
SET(sp->sector()->floorstat, SP_TAG6(sp));
RESET(sp->sector()->floorstat, FLOOR_STAT_PLAX);
}
}
@ -142,17 +142,17 @@ void FAF_DrawRooms(int x, int y, int z, fixed_t q16ang, fixed_t q16horiz, short
if (SP_TAG3(sp) == 0)
{
// restore ceilingpicnum and ceilingstat
sector[sp->sectnum].ceilingpicnum = SP_TAG5(sp);
sector[sp->sectnum].ceilingstat = SP_TAG4(sp);
//RESET(sector[sp->sectnum].ceilingstat, CEILING_STAT_TYPE_MASK);
RESET(sector[sp->sectnum].ceilingstat, CEILING_STAT_PLAX);
sp->sector()->ceilingpicnum = SP_TAG5(sp);
sp->sector()->ceilingstat = SP_TAG4(sp);
//RESET(sp->sector()->ceilingstat, CEILING_STAT_TYPE_MASK);
RESET(sp->sector()->ceilingstat, CEILING_STAT_PLAX);
}
else if (SP_TAG3(sp) == 1)
{
sector[sp->sectnum].floorpicnum = SP_TAG5(sp);
sector[sp->sectnum].floorstat = SP_TAG4(sp);
//RESET(sector[sp->sectnum].floorstat, FLOOR_STAT_TYPE_MASK);
RESET(sector[sp->sectnum].floorstat, FLOOR_STAT_PLAX);
sp->sector()->floorpicnum = SP_TAG5(sp);
sp->sector()->floorstat = SP_TAG4(sp);
//RESET(sp->sector()->floorstat, FLOOR_STAT_TYPE_MASK);
RESET(sp->sector()->floorstat, FLOOR_STAT_PLAX);
}
}
}

View file

@ -324,7 +324,7 @@ int DoActorSectorDamage(DSWActor* actor)
USER* u = actor->u();
SPRITEp sp = &actor->s();
SECT_USERp sectu = SectUser[sp->sectnum].Data();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
if (u->Health <= 0)
return false;
@ -403,7 +403,7 @@ int DoActorDebris(DSWActor* actor)
{
USER* u = actor->u();
SPRITEp sp = &actor->s();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
int nx, ny;
// This was move from DoActorDie so actor's can't be walked through until they are on the floor
@ -418,8 +418,8 @@ int DoActorDebris(DSWActor* actor)
return 0;
case ZILLA_RUN_R0:
getzsofslope(sp->sectnum, sp->x, sp->y, &u->hiz, &u->loz);
u->lo_sectp = &sector[sp->sectnum];
u->hi_sectp = &sector[sp->sectnum];
u->lo_sectp = sp->sector();
u->hi_sectp = sp->sector();
u->lowActor = nullptr;
u->highActor = nullptr;
break;
@ -519,7 +519,7 @@ void KeepActorOnFloor(DSWActor* actor)
SECTORp sectp;
int depth;
sectp = &sector[sp->sectnum];
sectp = sp->sector();
RESET(sp->cstat, CSTAT_SPRITE_YFLIP); // If upside down, reset it

View file

@ -657,12 +657,12 @@ bool UserBreakWall(WALLp wp, short)
DoSpawnSpotsForKill(match);
RESET(wp->cstat, flags);
if (wp->nextwall >= 0)
RESET(wall[wp->nextwall].cstat, flags);
RESET(wp->nextWall()->cstat, flags);
// clear tags
wp->hitag = wp->lotag = 0;
if (wp->nextwall >= 0)
wall[wp->nextwall].hitag = wall[wp->nextwall].lotag = 0;
wp->nextWall()->hitag = wp->nextWall()->lotag = 0;
return true;
}
@ -683,7 +683,7 @@ bool UserBreakWall(WALLp wp, short)
// clear tags
wp->hitag = wp->lotag = 0;
if (wp->nextwall >= 0)
wall[wp->nextwall].hitag = wall[wp->nextwall].lotag = 0;
wp->nextWall()->hitag = wp->nextWall()->lotag = 0;
ret = false;
}
else if (SP_TAG8(sp) == 1)
@ -691,11 +691,11 @@ bool UserBreakWall(WALLp wp, short)
// clear flags
RESET(wp->cstat, flags);
if (wp->nextwall >= 0)
RESET(wall[wp->nextwall].cstat, flags);
RESET(wp->nextWall()->cstat, flags);
// clear tags
wp->hitag = wp->lotag = 0;
if (wp->nextwall >= 0)
wall[wp->nextwall].hitag = wall[wp->nextwall].lotag = 0;
wp->nextWall()->hitag = wp->nextWall()->lotag = 0;
ret = true;
}
@ -707,12 +707,12 @@ bool UserBreakWall(WALLp wp, short)
// clear flags
RESET(wp->cstat, block_flags);
if (wp->nextwall >= 0)
RESET(wall[wp->nextwall].cstat, block_flags);
RESET(wp->nextWall()->cstat, block_flags);
// clear tags
wp->hitag = wp->lotag = 0;
if (wp->nextwall >= 0)
wall[wp->nextwall].hitag = wall[wp->nextwall].lotag = 0;
wp->nextWall()->hitag = wp->nextWall()->lotag = 0;
ret = false;
}

View file

@ -1330,7 +1330,7 @@ int DoBunnyMove(DSWActor* actor)
if (RandomRange(1000) > 985 && sp->pal != PALETTE_PLAYER1 && u->track < 0)
{
switch (sector[sp->sectnum].floorpicnum)
switch (sp->sector()->floorpicnum)
{
case 153:
case 154:
@ -1391,7 +1391,7 @@ int DoBunnyEat(DSWActor* actor)
DoActorSectorDamage(actor);
switch (sector[sp->sectnum].floorpicnum)
switch (sp->sector()->floorpicnum)
{
case 153:
case 154:

View file

@ -196,7 +196,7 @@ void CopySectorMatch(short match)
SECTOR_OBJECTp sop;
// find and add sprite to SO
sop = DetectSectorObject(&sector[sp->sectnum]);
sop = DetectSectorObject(sp->sector());
AddSpriteToSectorObject(itActor, sop);
// update sprites postions so they aren't in the

View file

@ -87,7 +87,7 @@ void
ShadeSprite(tspriteptr_t tsp)
{
// set shade of sprite
tsp->shade = sector[tsp->sectnum].floorshade - 25;
tsp->shade = tsp->sector()->floorshade - 25;
if (tsp->shade > -3)
tsp->shade = -3;
@ -665,9 +665,9 @@ void analyzesprites(spritetype* tsprite, int& spritesortcnt, int viewx, int view
}
// set palette lookup correctly
if (tsp->pal != sector[tsp->sectnum].floorpal)
if (tsp->pal != tsp->sector()->floorpal)
{
if (sector[tsp->sectnum].floorpal == PALETTE_DEFAULT)
if (tsp->sector()->floorpal == PALETTE_DEFAULT)
{
// default pal for sprite is stored in tu->spal
// mostly for players and other monster types
@ -677,7 +677,7 @@ void analyzesprites(spritetype* tsprite, int& spritesortcnt, int viewx, int view
{
// if sector pal is something other than default
SECT_USERp sectu = SectUser[tsp->sectnum].Data();
uint8_t pal = sector[tsp->sectnum].floorpal;
uint8_t pal = tsp->sector()->floorpal;
bool nosectpal=false;
// sprite does not take on the new pal if sector flag is set
@ -795,10 +795,10 @@ void analyzesprites(spritetype* tsprite, int& spritesortcnt, int viewx, int view
tsp->shade = int8_t(newshade);
}
if (TEST(sector[tsp->sectnum].ceilingstat, CEILING_STAT_PLAX))
if (TEST(tsp->sector()->ceilingstat, CEILING_STAT_PLAX))
{
newshade = tsp->shade;
newshade += sector[tsp->sectnum].ceilingshade;
newshade += tsp->sector()->ceilingshade;
if (newshade > 127) newshade = 127;
if (newshade < -128) newshade = -128;
tsp->shade = int8_t(newshade);
@ -806,7 +806,7 @@ void analyzesprites(spritetype* tsprite, int& spritesortcnt, int viewx, int view
else
{
newshade = tsp->shade;
newshade += sector[tsp->sectnum].floorshade;
newshade += tsp->sector()->floorshade;
if (newshade > 127) newshade = 127;
if (newshade < -128) newshade = -128;
tsp->shade = int8_t(newshade);
@ -1264,7 +1264,7 @@ DSWActor* ConnectCopySprite(spritetype const * tsp)
newsector = tsp->sectnum;
testz = SPRITEp_TOS(tsp) - Z(10);
if (testz < sector[tsp->sectnum].ceilingz)
if (testz < tsp->sector()->ceilingz)
updatesectorz(tsp->x, tsp->y, testz, &newsector);
if (newsector >= 0 && newsector != tsp->sectnum)
@ -1278,7 +1278,7 @@ DSWActor* ConnectCopySprite(spritetype const * tsp)
newsector = tsp->sectnum;
testz = SPRITEp_BOS(tsp) + Z(10);
if (testz > sector[tsp->sectnum].floorz)
if (testz > tsp->sector()->floorz)
updatesectorz(tsp->x, tsp->y, testz, &newsector);
if (newsector >= 0 && newsector != tsp->sectnum)
@ -1388,21 +1388,21 @@ void UpdateWallPortalState()
if (SP_TAG3(sp) == 0)
{
// back up ceilingpicnum and ceilingstat
SP_TAG5(sp) = sector[sp->sectnum].ceilingpicnum;
sector[sp->sectnum].ceilingpicnum = SP_TAG2(sp);
SP_TAG4(sp) = sector[sp->sectnum].ceilingstat;
//SET(sector[sp->sectnum].ceilingstat, ((int)SP_TAG7(sp))<<7);
SET(sector[sp->sectnum].ceilingstat, SP_TAG6(sp));
RESET(sector[sp->sectnum].ceilingstat, CEILING_STAT_PLAX);
SP_TAG5(sp) = sp->sector()->ceilingpicnum;
sp->sector()->ceilingpicnum = SP_TAG2(sp);
SP_TAG4(sp) = sp->sector()->ceilingstat;
//SET(sp->sector()->ceilingstat, ((int)SP_TAG7(sp))<<7);
SET(sp->sector()->ceilingstat, SP_TAG6(sp));
RESET(sp->sector()->ceilingstat, CEILING_STAT_PLAX);
}
else if (SP_TAG3(sp) == 1)
{
SP_TAG5(sp) = sector[sp->sectnum].floorpicnum;
sector[sp->sectnum].floorpicnum = SP_TAG2(sp);
SP_TAG4(sp) = sector[sp->sectnum].floorstat;
//SET(sector[sp->sectnum].floorstat, ((int)SP_TAG7(sp))<<7);
SET(sector[sp->sectnum].floorstat, SP_TAG6(sp));
RESET(sector[sp->sectnum].floorstat, FLOOR_STAT_PLAX);
SP_TAG5(sp) = sp->sector()->floorpicnum;
sp->sector()->floorpicnum = SP_TAG2(sp);
SP_TAG4(sp) = sp->sector()->floorstat;
//SET(sp->sector()->floorstat, ((int)SP_TAG7(sp))<<7);
SET(sp->sector()->floorstat, SP_TAG6(sp));
RESET(sp->sector()->floorstat, FLOOR_STAT_PLAX);
}
}
@ -1417,17 +1417,17 @@ void RestorePortalState()
if (SP_TAG3(sp) == 0)
{
// restore ceilingpicnum and ceilingstat
sector[sp->sectnum].ceilingpicnum = SP_TAG5(sp);
sector[sp->sectnum].ceilingstat = SP_TAG4(sp);
//RESET(sector[sp->sectnum].ceilingstat, CEILING_STAT_TYPE_MASK);
RESET(sector[sp->sectnum].ceilingstat, CEILING_STAT_PLAX);
sp->sector()->ceilingpicnum = SP_TAG5(sp);
sp->sector()->ceilingstat = SP_TAG4(sp);
//RESET(sp->sector()->ceilingstat, CEILING_STAT_TYPE_MASK);
RESET(sp->sector()->ceilingstat, CEILING_STAT_PLAX);
}
else if (SP_TAG3(sp) == 1)
{
sector[sp->sectnum].floorpicnum = SP_TAG5(sp);
sector[sp->sectnum].floorstat = SP_TAG4(sp);
//RESET(sector[sp->sectnum].floorstat, FLOOR_STAT_TYPE_MASK);
RESET(sector[sp->sectnum].floorstat, FLOOR_STAT_PLAX);
sp->sector()->floorpicnum = SP_TAG5(sp);
sp->sector()->floorstat = SP_TAG4(sp);
//RESET(sp->sector()->floorstat, FLOOR_STAT_TYPE_MASK);
RESET(sp->sector()->floorstat, FLOOR_STAT_PLAX);
}
}
}

View file

@ -439,13 +439,13 @@ int DoEelMatchPlayerZ(DSWActor* actor)
{
if (u->hi_sectp)
{
u->hiz = sector[sp->sectnum].ceilingz + Z(16);
u->hi_sectp = &sector[sp->sectnum];
u->hiz = sp->sector()->ceilingz + Z(16);
u->hi_sectp = sp->sector();
}
else
{
if (u->hiz < sector[sp->sectnum].ceilingz + Z(16))
u->hiz = sector[sp->sectnum].ceilingz + Z(16);
if (u->hiz < sp->sector()->ceilingz + Z(16))
u->hiz = sp->sector()->ceilingz + Z(16);
}
}

View file

@ -2202,12 +2202,12 @@ struct GameInterface : public ::GameInterface
// OVER and UNDER water macros
inline bool SpriteInDiveArea(SPRITEp sp)
{
return (TEST(sector[(sp)->sectnum].extra, SECTFX_DIVE_AREA) ? true : false);
return (TEST(sp->sector()->extra, SECTFX_DIVE_AREA) ? true : false);
}
inline bool SpriteInUnderwaterArea(SPRITEp sp)
{
return (TEST(sector[(sp)->sectnum].extra, SECTFX_UNDERWATER | SECTFX_UNDERWATER2) ? true : false);
return (TEST(sp->sector()->extra, SECTFX_UNDERWATER | SECTFX_UNDERWATER2) ? true : false);
}
inline bool SectorIsDiveArea(int sect)

View file

@ -66,15 +66,15 @@ void SectorLightShade(DSWActor* actor, short intensity)
if (!TEST_BOOL2(sp))
{
if (!TEST_BOOL6(sp))
sector[sp->sectnum].floorpal = sp->pal;
sector[sp->sectnum].floorshade = LIGHT_FloorShade(sp) + intensity; // floor change
sp->sector()->floorpal = sp->pal;
sp->sector()->floorshade = LIGHT_FloorShade(sp) + intensity; // floor change
}
if (!TEST_BOOL3(sp))
{
if (!TEST_BOOL6(sp))
sector[sp->sectnum].ceilingpal = sp->pal;
sector[sp->sectnum].ceilingshade = LIGHT_CeilingShade(sp) + intensity; // ceiling change
sp->sector()->ceilingpal = sp->pal;
sp->sector()->ceilingshade = LIGHT_CeilingShade(sp) + intensity; // ceiling change
}
// change wall
@ -83,8 +83,8 @@ void SectorLightShade(DSWActor* actor, short intensity)
ASSERT(u && u->WallShade.Data());
wall_shade = u->WallShade.Data();
startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
for (w = startwall, wallcount = 0; w <= endwall; w++)
{

View file

@ -1758,7 +1758,7 @@ void UpdatePlayerUnderSprite(PLAYERp pp)
zdiff = SPRITEp_BOS(over_sp) - water_level_z;
// add diff to ceiling
sp->z = sector[sp->sectnum].ceilingz + zdiff;
sp->z = sp->sector()->ceilingz + zdiff;
u->State = over_u->State;
u->Rot = over_u->Rot;

View file

@ -632,23 +632,23 @@ SetupMirrorTiles(void)
{
sp = &actor->s();
if (sector[sp->sectnum].ceilingpicnum == FAF_PLACE_MIRROR_PIC)
if (sp->sector()->ceilingpicnum == FAF_PLACE_MIRROR_PIC)
{
sector[sp->sectnum].ceilingpicnum = FAF_MIRROR_PIC;
SET(sector[sp->sectnum].ceilingstat, CEILING_STAT_PLAX);
sp->sector()->ceilingpicnum = FAF_MIRROR_PIC;
SET(sp->sector()->ceilingstat, CEILING_STAT_PLAX);
}
if (sector[sp->sectnum].floorpicnum == FAF_PLACE_MIRROR_PIC)
if (sp->sector()->floorpicnum == FAF_PLACE_MIRROR_PIC)
{
sector[sp->sectnum].floorpicnum = FAF_MIRROR_PIC;
SET(sector[sp->sectnum].floorstat, FLOOR_STAT_PLAX);
sp->sector()->floorpicnum = FAF_MIRROR_PIC;
SET(sp->sector()->floorstat, FLOOR_STAT_PLAX);
}
if (sector[sp->sectnum].ceilingpicnum == FAF_PLACE_MIRROR_PIC+1)
sector[sp->sectnum].ceilingpicnum = FAF_MIRROR_PIC+1;
if (sp->sector()->ceilingpicnum == FAF_PLACE_MIRROR_PIC+1)
sp->sector()->ceilingpicnum = FAF_MIRROR_PIC+1;
if (sector[sp->sectnum].floorpicnum == FAF_PLACE_MIRROR_PIC+1)
sector[sp->sectnum].floorpicnum = FAF_MIRROR_PIC+1;
if (sp->sector()->floorpicnum == FAF_PLACE_MIRROR_PIC+1)
sp->sector()->floorpicnum = FAF_MIRROR_PIC+1;
}
}
@ -787,8 +787,8 @@ bool FindCeilingView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* se
if (!testnewrenderer)
{
pix_diff = labs(z - sector[sp->sectnum].floorz) >> 8;
newz = sector[sp->sectnum].floorz + ((pix_diff / 128) + 1) * Z(128);
pix_diff = labs(z - sp->sector()->floorz) >> 8;
newz = sp->sector()->floorz + ((pix_diff / 128) + 1) * Z(128);
it.Reset(STAT_FAF);
while (auto actor = it.Next())
@ -802,15 +802,15 @@ bool FindCeilingView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* se
{
// save it off
save.sectnum[save.zcount] = sp->sectnum;
save.zval[save.zcount] = sector[sp->sectnum].floorz;
save.pic[save.zcount] = sector[sp->sectnum].floorpicnum;
save.slope[save.zcount] = sector[sp->sectnum].floorheinum;
save.zval[save.zcount] = sp->sector()->floorz;
save.pic[save.zcount] = sp->sector()->floorpicnum;
save.slope[save.zcount] = sp->sector()->floorheinum;
sector[sp->sectnum].floorz = newz;
sp->sector()->floorz = newz;
// don't change FAF_MIRROR_PIC - ConnectArea
if (sector[sp->sectnum].floorpicnum != FAF_MIRROR_PIC)
sector[sp->sectnum].floorpicnum = FAF_MIRROR_PIC + 1;
sector[sp->sectnum].floorheinum = 0;
if (sp->sector()->floorpicnum != FAF_MIRROR_PIC)
sp->sector()->floorpicnum = FAF_MIRROR_PIC + 1;
sp->sector()->floorheinum = 0;
save.zcount++;
PRODUCTION_ASSERT(save.zcount < ZMAX);
@ -883,8 +883,8 @@ bool FindFloorView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sect
if (!testnewrenderer)
{
// move ceiling multiple of 128 so that the wall tile will line up
pix_diff = labs(z - sector[sp->sectnum].ceilingz) >> 8;
newz = sector[sp->sectnum].ceilingz - ((pix_diff / 128) + 1) * Z(128);
pix_diff = labs(z - sp->sector()->ceilingz) >> 8;
newz = sp->sector()->ceilingz - ((pix_diff / 128) + 1) * Z(128);
it.Reset(STAT_FAF);
while (auto actor = it.Next())
@ -898,16 +898,16 @@ bool FindFloorView(short match, int32_t* x, int32_t* y, int32_t z, int16_t* sect
{
// save it off
save.sectnum[save.zcount] = sp->sectnum;
save.zval[save.zcount] = sector[sp->sectnum].ceilingz;
save.pic[save.zcount] = sector[sp->sectnum].ceilingpicnum;
save.slope[save.zcount] = sector[sp->sectnum].ceilingheinum;
save.zval[save.zcount] = sp->sector()->ceilingz;
save.pic[save.zcount] = sp->sector()->ceilingpicnum;
save.slope[save.zcount] = sp->sector()->ceilingheinum;
sector[sp->sectnum].ceilingz = newz;
sp->sector()->ceilingz = newz;
// don't change FAF_MIRROR_PIC - ConnectArea
if (sector[sp->sectnum].ceilingpicnum != FAF_MIRROR_PIC)
sector[sp->sectnum].ceilingpicnum = FAF_MIRROR_PIC + 1;
sector[sp->sectnum].ceilingheinum = 0;
if (sp->sector()->ceilingpicnum != FAF_MIRROR_PIC)
sp->sector()->ceilingpicnum = FAF_MIRROR_PIC + 1;
sp->sector()->ceilingheinum = 0;
save.zcount++;
PRODUCTION_ASSERT(save.zcount < ZMAX);

View file

@ -238,8 +238,8 @@ void DoRotatorSetInterp(DSWActor* actor)
SPRITEp sp = &actor->s();
short w,startwall,endwall;
startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
// move points
for (w = startwall; w <= endwall; w++)
@ -261,8 +261,8 @@ void DoRotatorStopInterp(DSWActor* actor)
SPRITEp sp = &actor->s();
short w,startwall,endwall;
startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
// move points
for (w = startwall; w <= endwall; w++)
@ -381,8 +381,8 @@ int DoRotator(DSWActor* actor)
if (!pivot)
return 0;
startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
// move points
for (w = startwall, ndx = 0; w <= endwall; w++)

View file

@ -1367,7 +1367,7 @@ void DoChangorMatch(short match)
while (auto actor = it.Next())
{
auto sp = &actor->s();
sectp = &sector[sp->sectnum];
sectp = sp->sector();
if (SP_TAG2(sp) != match)
continue;
@ -2771,7 +2771,7 @@ void DoPanning(void)
while (auto actor = it.Next())
{
sp = &actor->s();
sectp = &sector[sp->sectnum];
sectp = sp->sector();
nx = MulScale(sp->xvel, bcos(sp->ang), 20);
ny = MulScale(sp->xvel, bsin(sp->ang), 20);
@ -2784,7 +2784,7 @@ void DoPanning(void)
while (auto actor = it.Next())
{
sp = &actor->s();
sectp = &sector[sp->sectnum];
sectp = sp->sector();
nx = MulScale(sp->xvel, bcos(sp->ang), 20);
ny = MulScale(sp->xvel, bsin(sp->ang), 20);

View file

@ -229,8 +229,8 @@ void DoSlidorInterp(DSWActor* actor, INTERP_FUNC interp_func)
auto sp = &actor->s();
short w, pw, startwall, endwall;
w = startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
w = startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
do
{
@ -355,8 +355,8 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt)
auto sp = &actor->s();
short w, pw, startwall, endwall;
w = startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
w = startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
do
{
@ -469,7 +469,7 @@ int DoSlidorInstantClose(DSWActor* actor)
short w, startwall;
int diff;
w = startwall = sector[sp->sectnum].wallptr;
w = startwall = sp->sector()->wallptr;
do
{
@ -621,8 +621,8 @@ int DoSlidor(DSWActor* actor)
{
pp = Player + pnum;
if (pp->lo_sectp == &sector[sp->sectnum] ||
pp->hi_sectp == &sector[sp->sectnum])
if (pp->lo_sectp == sp->sector() ||
pp->hi_sectp == sp->sector())
{
ReverseSlidor(actor);

View file

@ -95,7 +95,7 @@ void SetSpikeActive(DSWActor* actor)
{
USERp u = actor->u();
SPRITEp sp = &actor->s();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
if (TEST(sp->cstat, CSTAT_SPRITE_YFLIP))
StartInterpolation(sp->sectnum, Interp_Sect_Ceilingheinum);
@ -123,7 +123,7 @@ void SetSpikeInactive(DSWActor* actor)
{
USERp u = actor->u();
SPRITEp sp = &actor->s();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
if (TEST(sp->cstat, CSTAT_SPRITE_YFLIP))
StopInterpolation(sp->sectnum, Interp_Sect_Ceilingheinum);
@ -404,8 +404,8 @@ int DoSpike(DSWActor* actor)
{
pp = Player + pnum;
if (pp->lo_sectp == &sector[sp->sectnum] ||
pp->hi_sectp == &sector[sp->sectnum])
if (pp->lo_sectp == sp->sector() ||
pp->hi_sectp == sp->sector())
{
ReverseSpike(actor);
found = true;

View file

@ -908,12 +908,12 @@ USERp SpawnUser(DSWActor* actor, short id, STATEp state)
// Problem with sprites spawned really close to white sector walls
// cant do a getzrange there
// Just put in some valid starting values
u->loz = sector[sp->sectnum].floorz;
u->hiz = sector[sp->sectnum].ceilingz;
u->loz = sp->sector()->floorz;
u->hiz = sp->sector()->ceilingz;
u->lowActor = nullptr;
u->highActor = nullptr;
u->lo_sectp = &sector[sp->sectnum];
u->hi_sectp = &sector[sp->sectnum];
u->lo_sectp = sp->sector();
u->hi_sectp = sp->sector();
return u;
}
@ -1880,7 +1880,7 @@ void SpriteSetup(void)
{
bit = 1 << (tag);
SET(sector[sp->sectnum].extra, bit);
SET(sp->sector()->extra, bit);
if (TEST(bit, SECTFX_SINK))
{
@ -2069,7 +2069,7 @@ void SpriteSetup(void)
case TRIGGER_SECTOR:
{
SET(sector[sp->sectnum].extra, SECTFX_TRIGGER);
SET(sp->sector()->extra, SECTFX_TRIGGER);
change_actor_stat(actor, STAT_TRIGGER);
break;
}
@ -2102,16 +2102,16 @@ void SpriteSetup(void)
if (SP_TAG7(sp) == 0 || SP_TAG7(sp) == 1)
{
if (SP_TAG3(sp) == 0)
SET(sector[sp->sectnum].ceilingstat, CEILING_STAT_FAF_BLOCK_HITSCAN);
SET(sp->sector()->ceilingstat, CEILING_STAT_FAF_BLOCK_HITSCAN);
else
SET(sector[sp->sectnum].floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN);
SET(sp->sector()->floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN);
}
else if (TEST_BOOL1(sp))
{
if (SP_TAG3(sp) == 0)
SET(sector[sp->sectnum].ceilingstat, CEILING_STAT_FAF_BLOCK_HITSCAN);
SET(sp->sector()->ceilingstat, CEILING_STAT_FAF_BLOCK_HITSCAN);
else
SET(sector[sp->sectnum].floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN);
SET(sp->sector()->floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN);
}
// copy tag 7 to tag 6 and pre-shift it
@ -2155,7 +2155,7 @@ void SpriteSetup(void)
case SECT_VATOR:
{
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
SECT_USERp sectu;
short speed,vel,time,type,start_on,floor_vator;
u = SpawnUser(actor, 0, nullptr);
@ -2168,7 +2168,7 @@ void SpriteSetup(void)
}
SET(sectp->extra, SECTFX_VATOR);
SetSectorWallBits(sp->sectnum, WALLFX_DONT_STICK, true, true);
SET(sector[sp->sectnum].extra, SECTFX_DYNAMIC_AREA);
SET(sp->sector()->extra, SECTFX_DYNAMIC_AREA);
// don't step on toes of other sector settings
if (sectp->lotag == 0 && sectp->hitag == 0)
@ -2265,7 +2265,7 @@ void SpriteSetup(void)
case SECT_ROTATOR:
{
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
short time,type;
short wallcount,startwall,endwall,w;
u = SpawnUser(actor, 0, nullptr);
@ -2282,8 +2282,8 @@ void SpriteSetup(void)
u->WaitTics = time*15; // 1/8 of a sec
u->Tics = 0;
startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
// count walls of sector
for (w = startwall, wallcount = 0; w <= endwall; w++)
@ -2326,7 +2326,7 @@ void SpriteSetup(void)
case SECT_SLIDOR:
{
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
short time,type;
u = SpawnUser(actor, 0, nullptr);
@ -2384,7 +2384,7 @@ void SpriteSetup(void)
u = SpawnUser(actor, 0, nullptr);
SetSectorWallBits(sp->sectnum, WALLFX_DONT_STICK, false, true);
SET(sector[sp->sectnum].extra, SECTFX_DYNAMIC_AREA);
SET(sp->sector()->extra, SECTFX_DYNAMIC_AREA);
type = SP_TAG3(sp);
speed = SP_TAG4(sp);
@ -2477,11 +2477,11 @@ void SpriteSetup(void)
LIGHT_ShadeInc(sp) = 1;
// save off original floor and ceil shades
LIGHT_FloorShade(sp) = sector[sp->sectnum].floorshade;
LIGHT_CeilingShade(sp) = sector[sp->sectnum].ceilingshade;
LIGHT_FloorShade(sp) = sp->sector()->floorshade;
LIGHT_CeilingShade(sp) = sp->sector()->ceilingshade;
startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
// count walls of sector
for (w = startwall, wallcount = 0; w <= endwall; w++)
@ -2531,11 +2531,11 @@ void SpriteSetup(void)
LIGHT_Tics(sp) = 0;
// save off original floor and ceil shades
LIGHT_FloorShade(sp) = sector[sp->sectnum].floorshade;
LIGHT_CeilingShade(sp) = sector[sp->sectnum].ceilingshade;
LIGHT_FloorShade(sp) = sp->sector()->floorshade;
LIGHT_CeilingShade(sp) = sp->sector()->ceilingshade;
startwall = sector[sp->sectnum].wallptr;
endwall = startwall + sector[sp->sectnum].wallnum - 1;
startwall = sp->sector()->wallptr;
endwall = startwall + sp->sector()->wallnum - 1;
// count walls of sector
for (w = startwall, wallcount = 0; w <= endwall; w++)
@ -2623,7 +2623,7 @@ void SpriteSetup(void)
case SECT_EXPLODING_CEIL_FLOOR:
{
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
SetSectorWallBits(sp->sectnum, WALLFX_DONT_STICK, false, true);
@ -2795,7 +2795,7 @@ void SpriteSetup(void)
case PLAX_GLOB_Z_ADJUST:
{
SET(sector[sp->sectnum].extra, SECTFX_Z_ADJUST);
SET(sp->sector()->extra, SECTFX_Z_ADJUST);
PlaxCeilGlobZadjust = SP_TAG2(sp);
PlaxFloorGlobZadjust = SP_TAG3(sp);
KillActor(actor);
@ -2804,16 +2804,16 @@ void SpriteSetup(void)
case CEILING_Z_ADJUST:
{
//SET(sector[sp->sectnum].ceilingstat, CEILING_STAT_FAF_BLOCK_HITSCAN);
SET(sector[sp->sectnum].extra, SECTFX_Z_ADJUST);
//SET(sp->sector()->ceilingstat, CEILING_STAT_FAF_BLOCK_HITSCAN);
SET(sp->sector()->extra, SECTFX_Z_ADJUST);
change_actor_stat(actor, STAT_ST1);
break;
}
case FLOOR_Z_ADJUST:
{
//SET(sector[sp->sectnum].floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN);
SET(sector[sp->sectnum].extra, SECTFX_Z_ADJUST);
//SET(sp->sector()->floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN);
SET(sp->sector()->extra, SECTFX_Z_ADJUST);
change_actor_stat(actor, STAT_ST1);
break;
}
@ -2824,7 +2824,7 @@ void SpriteSetup(void)
short sectnum = sp->sectnum;
SET(sp->cstat, CSTAT_SPRITE_INVISIBLE);
SET(sector[sp->sectnum].extra, SECTFX_WARP_SECTOR);
SET(sp->sector()->extra, SECTFX_WARP_SECTOR);
change_actor_stat(actor, STAT_WARP);
// if just a destination teleporter
@ -2855,19 +2855,19 @@ void SpriteSetup(void)
case WARP_FLOOR_PLANE:
{
SET(sp->cstat, CSTAT_SPRITE_INVISIBLE);
SET(sector[sp->sectnum].extra, SECTFX_WARP_SECTOR);
SET(sp->sector()->extra, SECTFX_WARP_SECTOR);
change_actor_stat(actor, STAT_WARP);
break;
}
case WARP_COPY_SPRITE1:
SET(sp->cstat, CSTAT_SPRITE_INVISIBLE);
SET(sector[sp->sectnum].extra, SECTFX_WARP_SECTOR);
SET(sp->sector()->extra, SECTFX_WARP_SECTOR);
change_actor_stat(actor, STAT_WARP_COPY_SPRITE1);
break;
case WARP_COPY_SPRITE2:
SET(sp->cstat, CSTAT_SPRITE_INVISIBLE);
SET(sector[sp->sectnum].extra, SECTFX_WARP_SECTOR);
SET(sp->sector()->extra, SECTFX_WARP_SECTOR);
change_actor_stat(actor, STAT_WARP_COPY_SPRITE2);
break;
@ -2920,7 +2920,7 @@ void SpriteSetup(void)
{
sectu = GetSectUser(sp->sectnum);
SET(sectu->flags, SECTFU_SO_SLOPE_FLOOR_TO_POINT);
SET(sector[sp->sectnum].extra, SECTFX_DYNAMIC_AREA);
SET(sp->sector()->extra, SECTFX_DYNAMIC_AREA);
KillActor(actor);
break;
}
@ -2929,7 +2929,7 @@ void SpriteSetup(void)
{
sectu = GetSectUser(sp->sectnum);
SET(sectu->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT);
SET(sector[sp->sectnum].extra, SECTFX_DYNAMIC_AREA);
SET(sp->sector()->extra, SECTFX_DYNAMIC_AREA);
KillActor(actor);
break;
}
@ -3060,8 +3060,8 @@ KeyMain:
*
* sp->ang = 0; sp->xvel = 4;
*
* if (labs(sp->z - sector[sp->sectnum].floorz) < Z(32)) sp->z =
* sector[sp->sectnum].floorz - Z(32);
* if (labs(sp->z - sp->sector()->floorz) < Z(32)) sp->z =
* sp->sector()->floorz - Z(32);
*
* u->sz = sp->z;
*
@ -3549,8 +3549,8 @@ NUKE_REPLACEMENT:
u = SpawnUser(actor, ICON_FLAG, s_IconFlag);
u->spal = sp->pal;
sector[sp->sectnum].hitag = 9000; // Put flag's color in sect containing it
sector[sp->sectnum].lotag = u->spal;
sp->sector()->hitag = 9000; // Put flag's color in sect containing it
sp->sector()->lotag = u->spal;
IconDefault(actor);
PicAnimOff(sp->picnum);
break;
@ -6847,7 +6847,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
if (FAF_ConnectArea(sp->sectnum))
SetActorZ(actor, &sp->pos);
if (TEST(sector[sp->sectnum].extra, SECTFX_WARP_SECTOR))
if (TEST(sp->sector()->extra, SECTFX_WARP_SECTOR))
{
DSWActor* sp_warp;
@ -6867,17 +6867,17 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
}
}
if (retval.type != kHitNone && TEST(sector[sp->sectnum].ceilingstat, CEILING_STAT_PLAX))
if (retval.type != kHitNone && TEST(sp->sector()->ceilingstat, CEILING_STAT_PLAX))
{
if (sp->z < sector[sp->sectnum].ceilingz)
if (sp->z < sp->sector()->ceilingz)
{
retval.setSky();
}
}
if (retval.type != kHitNone && TEST(sector[sp->sectnum].floorstat, FLOOR_STAT_PLAX))
if (retval.type != kHitNone && TEST(sp->sector()->floorstat, FLOOR_STAT_PLAX))
{
if (sp->z > sector[sp->sectnum].floorz)
if (sp->z > sp->sector()->floorz)
{
retval.setSky();
}
@ -6970,7 +6970,7 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
getzsofslope(sp->sectnum, sp->x, sp->y, &u->hiz, &u->loz);
u->hi_sectp = u->lo_sectp = &sector[sp->sectnum];
u->hi_sectp = u->lo_sectp = sp->sector();
u->highActor = nullptr; u->lowActor = nullptr;
sp->z = u->loz - Z(8);
@ -6981,7 +6981,7 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
return retval;
}
if (TEST(sector[sp->sectnum].extra, SECTFX_WARP_SECTOR))
if (TEST(sp->sector()->extra, SECTFX_WARP_SECTOR))
{
DSWActor* sp_warp;

View file

@ -968,7 +968,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop)
if (sop->sector[j] == sp->sectnum)
{
SET(u->Flags, SPR_ON_SO_SECTOR);
u->sz = sector[sp->sectnum].floorz - sp->z;
u->sz = sp->sector()->floorz - sp->z;
break;
}
}
@ -1804,7 +1804,7 @@ PlayerPart:
if (TEST(u->Flags, SPR_ON_SO_SECTOR))
{
// move with sector its on
sp->z = sector[sp->sectnum].floorz - u->sz;
sp->z = sp->sector()->floorz - u->sz;
}
else
{
@ -1823,10 +1823,10 @@ PlayerPart:
// IS part of a sector, sprite can do things based on the
// current sector it is in
if (TEST(wall[sector[sp->sectnum].wallptr].extra, WALLFX_LOOP_DONT_SPIN))
if (TEST(wall[sp->sector()->wallptr].extra, WALLFX_LOOP_DONT_SPIN))
continue;
if (TEST(wall[sector[sp->sectnum].wallptr].extra, WALLFX_LOOP_REVERSE_SPIN))
if (TEST(wall[sp->sector()->wallptr].extra, WALLFX_LOOP_REVERSE_SPIN))
{
rotatepoint(sop->pmid.vec2, sp->pos.vec2, -delta_ang, &sp->pos.vec2);
sp->ang = NORM_ANGLE(sp->ang - delta_ang);
@ -3462,7 +3462,7 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor)
if (TEST(u->Flags, SPR_ZDIFF_MODE))
{
RESET(u->Flags, SPR_ZDIFF_MODE);
sp->z = sector[sp->sectnum].floorz;
sp->z = sp->sector()->floorz;
sp->zvel = 0;
}
else

View file

@ -100,7 +100,7 @@ void SetVatorActive(DSWActor* actor)
{
USERp u = actor->u();
SPRITEp sp = &actor->s();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
if (TEST(sp->cstat, CSTAT_SPRITE_YFLIP))
StartInterpolation(sp->sectnum, Interp_Sect_Ceilingz);
@ -128,7 +128,7 @@ void SetVatorInactive(DSWActor* actor)
{
USERp u = actor->u();
SPRITEp sp = &actor->s();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
if (TEST(sp->cstat, CSTAT_SPRITE_YFLIP))
StopInterpolation(sp->sectnum, Interp_Sect_Ceilingz);
@ -409,7 +409,7 @@ int DoVator(DSWActor* actor)
{
USER* u = actor->u();
SPRITEp sp = &actor->s();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
int *lptr;
int amt;
@ -534,8 +534,8 @@ int DoVator(DSWActor* actor)
{
pp = Player + pnum;
if (pp->lo_sectp == &sector[sp->sectnum] ||
pp->hi_sectp == &sector[sp->sectnum])
if (pp->lo_sectp == sp->sector() ||
pp->hi_sectp == sp->sector())
{
ReverseVator(actor);
@ -577,7 +577,7 @@ int DoVatorAuto(DSWActor* actor)
{
USER* u = actor->u();
SPRITEp sp = &actor->s();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
int *lptr;
int amt;

View file

@ -4592,7 +4592,7 @@ int DoFireballFlames(DSWActor* actor)
{
if (SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed) > 0)
{
if (labs(sector[sp->sectnum].floorz - sp->z) <= Z(4))
if (labs(sp->sector()->floorz - sp->z) <= Z(4))
{
KillActor(actor);
return 0;
@ -4667,7 +4667,7 @@ int DoBreakFlames(DSWActor* actor)
{
if (SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed) > 0)
{
if (labs(sector[sp->sectnum].floorz - sp->z) <= Z(4))
if (labs(sp->sector()->floorz - sp->z) <= Z(4))
{
KillActor(actor);
return 0;
@ -10767,7 +10767,7 @@ void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECTp sop,
if (TEST(u->Flags, SPR_ON_SO_SECTOR))
{
// move with sector its on
exp->z = sector[sp->sectnum].floorz - u->sz;
exp->z = sp->sector()->floorz - u->sz;
exp->backupz();
}
else
@ -18209,7 +18209,7 @@ int SpawnSplash(DSWActor* actor)
SPRITEp sp = &actor->s(), wp;
SECT_USERp sectu = SectUser[sp->sectnum].Data();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
if (Prediction)
return 0;
@ -18234,7 +18234,7 @@ int SpawnSplash(DSWActor* actor)
wp->xrepeat = 45;
wp->yrepeat = 42;
wp->shade = sector[sp->sectnum].floorshade - 10;
wp->shade = sp->sector()->floorshade - 10;
return 0;
}
@ -18269,7 +18269,7 @@ int SpawnSplashXY(int hit_x, int hit_y, int hit_z, int sectnum)
wp->xrepeat = 45;
wp->yrepeat = 42;
wp->shade = sector[wp->sectnum].floorshade - 10;
wp->shade = wp->sector()->floorshade - 10;
return 0;
}
@ -18347,7 +18347,7 @@ DSWActor* SpawnBubble(DSWActor* actor)
bu->sy = bp->yrepeat;
bu->ceiling_dist = Z(1);
bu->floor_dist = Z(1);
bp->shade = sector[sp->sectnum].floorshade - 10;
bp->shade = sp->sector()->floorshade - 10;
bu->WaitTics = 120 * 120;
bp->zvel = 512;
bp->clipdist = 12 >> 2;
@ -18473,7 +18473,7 @@ int DoBubble(DSWActor* actor)
sp->xrepeat = u->sx + (RANDOM_P2(8 << 8) >> 8) - 4;
sp->yrepeat = u->sy + (RANDOM_P2(8 << 8) >> 8) - 4;
if (sp->z < sector[sp->sectnum].ceilingz)
if (sp->z < sp->sector()->ceilingz)
{
if (SectorIsUnderwaterArea(sectnum(u->hi_sectp)))
{
@ -19122,13 +19122,13 @@ void QueueGeneric(DSWActor* actor, short pic)
SPRITEp sp = &actor->s();
SPRITEp osp;
if (TEST(sector[sp->sectnum].extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_WATER)
if (TEST(sp->sector()->extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_WATER)
{
KillActor(actor);
return;
}
if (TEST(sector[sp->sectnum].extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA)
if (TEST(sp->sector()->extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA)
{
KillActor(actor);
return;
@ -19209,13 +19209,13 @@ DoShellShrap(DSWActor* actor)
}
// Get rid of shell if they fall in non-divable liquid areas
if (TEST(sector[sp->sectnum].extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_WATER)
if (TEST(sp->sector()->extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_WATER)
{
KillActor(actor);
return 0;
}
if (TEST(sector[sp->sectnum].extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA)
if (TEST(sp->sector()->extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA)
{
KillActor(actor);
return 0;
@ -19654,12 +19654,12 @@ void QueueLoWangs(DSWActor* actor)
DSWActor* NewSprite;
if (TEST(sector[sp->sectnum].extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_WATER)
if (TEST(sp->sector()->extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_WATER)
{
return;
}
if (TEST(sector[sp->sectnum].extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA)
if (TEST(sp->sector()->extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA)
{
return;
}

View file

@ -682,8 +682,8 @@ int NullZilla(DSWActor* actor)
if (u->State == s_ZillaDie)
{
getzsofslope(sp->sectnum, sp->x, sp->y, &u->hiz, &u->loz);
u->lo_sectp = &sector[sp->sectnum];
u->hi_sectp = &sector[sp->sectnum];
u->lo_sectp = sp->sector();
u->hi_sectp = sp->sector();
sp->z = u->loz;
}
#endif
@ -691,8 +691,8 @@ int NullZilla(DSWActor* actor)
//if (!TEST(u->Flags,SPR_CLIMBING))
// KeepActorOnFloor(actor);
getzsofslope(sp->sectnum, sp->x, sp->y, &u->hiz, &u->loz);
u->lo_sectp = &sector[sp->sectnum];
u->hi_sectp = &sector[sp->sectnum];
u->lo_sectp = sp->sector();
u->hi_sectp = sp->sector();
u->lowActor = nullptr;
u->highActor = nullptr;
sp->z = u->loz;
@ -765,8 +765,8 @@ int DoZillaDeathMelt(DSWActor* actor)
//KeepActorOnFloor(actor);
getzsofslope(sp->sectnum, sp->x, sp->y, &u->hiz, &u->loz);
u->lo_sectp = &sector[sp->sectnum];
u->hi_sectp = &sector[sp->sectnum];
u->lo_sectp = sp->sector();
u->hi_sectp = sp->sector();
u->lowActor = nullptr;
u->highActor = nullptr;
sp->z = u->loz;

View file

@ -812,7 +812,7 @@ void SpawnZombie2(DSWActor* actor)
SPRITEp np;
USERp nu;
SECT_USERp sectu = SectUser[sp->sectnum].Data();
SECTORp sectp = &sector[sp->sectnum];
SECTORp sectp = sp->sector();
auto ownerActor = GetOwner(actor);