mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- lots of search& replace actions.
This takes care of roughly 2/3 of the SectUser accesses.
This commit is contained in:
parent
4266edfa04
commit
5cda292d98
14 changed files with 138 additions and 130 deletions
|
@ -56,6 +56,11 @@ namespace Blood
|
|||
struct XSECTOR;
|
||||
}
|
||||
|
||||
namespace ShadowWarrior
|
||||
{
|
||||
struct SECT_USER;
|
||||
};
|
||||
|
||||
//40 bytes
|
||||
struct walltype;
|
||||
struct sectortype
|
||||
|
@ -101,6 +106,12 @@ struct sectortype
|
|||
bool hasX() const { return extra > 0; } // 0 is invalid!
|
||||
void addX();
|
||||
|
||||
// same for SW
|
||||
ShadowWarrior::SECT_USER* u() const;
|
||||
bool hasU() const { return u() != nullptr; }
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
//cstat:
|
||||
|
|
|
@ -296,7 +296,7 @@ void DoDebrisCurrent(DSWActor* actor)
|
|||
int nx, ny;
|
||||
USERp u = actor->u();
|
||||
auto sp = &actor->s();
|
||||
SECT_USERp sectu = SectUser[sp->sectnum].Data();
|
||||
SECT_USERp sectu = sp->sector()->u();
|
||||
|
||||
//sp->clipdist = (256+128)>>2;
|
||||
|
||||
|
@ -323,7 +323,7 @@ int DoActorSectorDamage(DSWActor* actor)
|
|||
{
|
||||
USER* u = actor->u();
|
||||
SPRITEp sp = &actor->s();
|
||||
SECT_USERp sectu = SectUser[sp->sectnum].Data();
|
||||
SECT_USERp sectu = sp->sector()->u();
|
||||
SECTORp sectp = sp->sector();
|
||||
|
||||
if (u->Health <= 0)
|
||||
|
@ -446,7 +446,7 @@ int DoActorDebris(DSWActor* actor)
|
|||
}
|
||||
}
|
||||
|
||||
if (SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed) > 10) // JBF: added null check
|
||||
if (sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed) > 10) // JBF: added null check
|
||||
{
|
||||
u->WaitTics = (u->WaitTics + (ACTORMOVETICS << 3)) & 1023;
|
||||
//sp->z = Z(2) + u->loz + ((Z(4) * (int) bsin(u->WaitTics)) >> 14);
|
||||
|
@ -527,7 +527,7 @@ void KeepActorOnFloor(DSWActor* actor)
|
|||
return;
|
||||
|
||||
if (u->lo_sectp && SectUser[sectnum(u->lo_sectp)].Data())
|
||||
depth = FixedToInt(SectUser[sectnum(u->lo_sectp)]->depth_fixed);
|
||||
depth = FixedToInt(u->lo_sectp->u()->depth_fixed);
|
||||
else
|
||||
depth = 0;
|
||||
|
||||
|
|
|
@ -654,8 +654,8 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
|
|||
hiz = u->hiz;
|
||||
|
||||
// adjust loz/hiz for water depth
|
||||
if (u->lo_sectp && SectUser[sectnum(u->lo_sectp)].Data() && FixedToInt(SectUser[sectnum(u->lo_sectp)]->depth_fixed))
|
||||
loz -= Z(FixedToInt(SectUser[sectnum(u->lo_sectp)]->depth_fixed)) - Z(8);
|
||||
if (u->lo_sectp && u->lo_sectp->hasU() && FixedToInt(u->lo_sectp->u()->depth_fixed))
|
||||
loz -= Z(FixedToInt(u->lo_sectp->u()->depth_fixed)) - Z(8);
|
||||
|
||||
// lower bound
|
||||
if (u->lowActor)
|
||||
|
|
|
@ -471,8 +471,8 @@ int DoEelMatchPlayerZ(DSWActor* actor)
|
|||
hiz = u->hiz;
|
||||
|
||||
// adjust loz/hiz for water depth
|
||||
if (u->lo_sectp && SectUser[sectnum(u->lo_sectp)].Data() && FixedToInt(SectUser[sectnum(u->lo_sectp)]->depth_fixed))
|
||||
loz -= Z(FixedToInt(SectUser[sectnum(u->lo_sectp)]->depth_fixed)) - Z(8);
|
||||
if (u->lo_sectp && u->lo_sectp->hasU() && FixedToInt(u->lo_sectp->u()->depth_fixed))
|
||||
loz -= Z(FixedToInt(u->lo_sectp->u()->depth_fixed)) - Z(8);
|
||||
|
||||
// lower bound
|
||||
if (u->lowActor && u->targetActor == u->highActor) // this doesn't look right...
|
||||
|
|
|
@ -38,6 +38,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "build.h"
|
||||
#include "d_net.h"
|
||||
#include "gamefuncs.h"
|
||||
|
||||
#include "mytypes.h"
|
||||
#include "sounds.h"
|
||||
|
@ -912,6 +913,8 @@ struct PLAYERstruct
|
|||
int cookieTime;
|
||||
|
||||
uint8_t WpnReloadState;
|
||||
|
||||
sectortype* cursector() const { return §or[cursectnum]; }
|
||||
};
|
||||
|
||||
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];
|
||||
|
@ -1686,10 +1689,10 @@ struct SECTOR_OBJECTstruct
|
|||
drive_slide,
|
||||
crush_z,
|
||||
op_main_sector, // main sector operational SO moves in - for speed purposes
|
||||
flags;
|
||||
flags,
|
||||
sector[MAX_SO_SECTOR]; // hold the sector numbers of the sector object
|
||||
|
||||
short sector[MAX_SO_SECTOR], // hold the sector numbers of the sector object
|
||||
xorig[MAX_SO_POINTS], // save the original x & y location of each wall so it can be
|
||||
short xorig[MAX_SO_POINTS], // save the original x & y location of each wall so it can be
|
||||
yorig[MAX_SO_POINTS], // refreshed
|
||||
sectnum, // current secnum of midpoint
|
||||
mid_sector, // middle sector
|
||||
|
@ -1760,6 +1763,7 @@ struct SECTOR_OBJECTstruct
|
|||
// limit rotation angle
|
||||
limit_ang_center, // for limiting the angle of turning - turrets etc
|
||||
limit_ang_delta; //
|
||||
|
||||
};
|
||||
|
||||
#define MAX_SECTOR_OBJECTS 20
|
||||
|
@ -2300,5 +2304,11 @@ extern short AnimCnt;
|
|||
|
||||
|
||||
END_SW_NS
|
||||
|
||||
inline ShadowWarrior::SECT_USER* sectortype::u() const
|
||||
{
|
||||
return ShadowWarrior::SectUser[sectnum(this)].Data();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -377,8 +377,8 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
|
|||
hiz = u->hiz;
|
||||
|
||||
// adjust loz/hiz for water depth
|
||||
if (u->lo_sectp && SectUser[sectnum(u->lo_sectp)].Data() && FixedToInt(SectUser[sectnum(u->lo_sectp)]->depth_fixed))
|
||||
loz -= Z(FixedToInt(SectUser[sectnum(u->lo_sectp)]->depth_fixed)) - Z(8);
|
||||
if (u->lo_sectp && u->lo_sectp->hasU() && FixedToInt(u->lo_sectp->u()->depth_fixed))
|
||||
loz -= Z(FixedToInt(u->lo_sectp->u()->depth_fixed)) - Z(8);
|
||||
|
||||
// lower bound
|
||||
if (u->lowActor)
|
||||
|
|
|
@ -505,7 +505,7 @@ int DoBloodSpray(DSWActor* actor)
|
|||
SET(u->Flags, SPR_BOUNCE); // no bouncing
|
||||
// underwater
|
||||
|
||||
if (u->lo_sectp && SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed))
|
||||
if (u->lo_sectp && sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed))
|
||||
SET(u->Flags, SPR_BOUNCE); // no bouncing on
|
||||
// shallow water
|
||||
|
||||
|
@ -723,7 +723,7 @@ int DoPhosphorus(DSWActor* actor)
|
|||
SET(u->Flags, SPR_BOUNCE); // no bouncing
|
||||
// underwater
|
||||
|
||||
if (u->lo_sectp && SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed))
|
||||
if (u->lo_sectp && sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed))
|
||||
SET(u->Flags, SPR_BOUNCE); // no bouncing on
|
||||
// shallow water
|
||||
|
||||
|
@ -951,7 +951,7 @@ int DoChemBomb(DSWActor* actor)
|
|||
SET(u->Flags, SPR_BOUNCE); // no bouncing
|
||||
// underwater
|
||||
|
||||
if (u->lo_sectp && SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed))
|
||||
if (u->lo_sectp && sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed))
|
||||
SET(u->Flags, SPR_BOUNCE); // no bouncing on
|
||||
// shallow water
|
||||
|
||||
|
@ -1168,7 +1168,7 @@ int DoCaltrops(DSWActor* actor)
|
|||
SET(u->Flags, SPR_BOUNCE); // no bouncing
|
||||
// underwater
|
||||
|
||||
if (u->lo_sectp && SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed))
|
||||
if (u->lo_sectp && sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed))
|
||||
SET(u->Flags, SPR_BOUNCE); // no bouncing on
|
||||
// shallow water
|
||||
|
||||
|
|
|
@ -357,8 +357,8 @@ MorphTornado(SECTOR_OBJECTp sop)
|
|||
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
if (SectUser[sectnum(*sectp)].Data() &&
|
||||
TEST(SectUser[sectnum(*sectp)]->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
if ((*sectp)->hasU() &&
|
||||
TEST((*sectp)->u()->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
{
|
||||
#define TOR_LOW (floorz)
|
||||
if (sop->morph_z > TOR_LOW)
|
||||
|
@ -450,8 +450,8 @@ MorphFloor(SECTOR_OBJECTp sop)
|
|||
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
if (SectUser[sectnum(*sectp)].Data() &&
|
||||
TEST(SectUser[sectnum(*sectp)]->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
if ((*sectp)->hasU() &&
|
||||
TEST((*sectp)->u()->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
{
|
||||
alignflorslope(sectnum(*sectp), mx, my, floorz + sop->morph_z);
|
||||
}
|
||||
|
@ -466,8 +466,8 @@ SOBJ_AlignFloorToPoint(SECTOR_OBJECTp sop, int x, int y, int z)
|
|||
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
if (SectUser[sectnum(*sectp)].Data() &&
|
||||
TEST(SectUser[sectnum(*sectp)]->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
if ((*sectp)->hasU() &&
|
||||
TEST((*sectp)->u()->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
{
|
||||
alignflorslope(int16_t(sectnum(*sectp)), x, y, z);
|
||||
}
|
||||
|
@ -482,8 +482,8 @@ SOBJ_AlignCeilingToPoint(SECTOR_OBJECTp sop, int x, int y, int z)
|
|||
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
if (SectUser[sectnum(*sectp)].Data() &&
|
||||
TEST(SectUser[sectnum(*sectp)]->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
if ((*sectp)->hasU() &&
|
||||
TEST((*sectp)->u()->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
{
|
||||
alignceilslope(int16_t(sectnum(*sectp)), x, y, z);
|
||||
}
|
||||
|
@ -498,8 +498,8 @@ SOBJ_AlignFloorCeilingToPoint(SECTOR_OBJECTp sop, int x, int y, int z)
|
|||
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
if (SectUser[sectnum(*sectp)].Data() &&
|
||||
TEST(SectUser[sectnum(*sectp)]->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
if ((*sectp)->hasU() &&
|
||||
TEST((*sectp)->u()->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
{
|
||||
alignflorslope(sectnum(*sectp), x, y, z);
|
||||
alignceilslope(sectnum(*sectp), x, y, z);
|
||||
|
@ -548,19 +548,6 @@ SpikeFloor(SECTOR_OBJECTp sop)
|
|||
}
|
||||
|
||||
SOBJ_AlignFloorToPoint(sop, mx, my, floorz + sop->morph_z);
|
||||
|
||||
#if 0
|
||||
SECTORp *sectp;
|
||||
int j;
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
if (SectUser[*sectp - sector] &&
|
||||
TEST(SectUser[*sectp - sector]->flags, SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||
{
|
||||
alignflorslope(*sectp - sector, mx, my, floorz + sop->morph_z);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6719,9 +6719,9 @@ pDisplaySprites(PLAYERp pp, double smoothratio)
|
|||
int16_t floorshade = 0;
|
||||
if (pp->cursectnum >= 0)
|
||||
{
|
||||
sectu = SectUser[pp->cursectnum].Data();
|
||||
pal = sector[pp->cursectnum].floorpal;
|
||||
floorshade = sector[pp->cursectnum].floorshade;
|
||||
sectu = pp->cursector()->u();
|
||||
pal = pp->cursector()->floorpal;
|
||||
floorshade = pp->cursector()->floorshade;
|
||||
|
||||
if (pal != PALETTE_DEFAULT)
|
||||
{
|
||||
|
@ -6740,7 +6740,7 @@ pDisplaySprites(PLAYERp pp, double smoothratio)
|
|||
SET(flags, RS_TRANS1);
|
||||
}
|
||||
|
||||
//shade = overlay_shade = DIV2(sector[pp->cursectnum].floorshade + sector[pp->cursectnum].ceilingshade);
|
||||
//shade = overlay_shade = DIV2(pp->cursector()->floorshade + pp->cursector()->ceilingshade);
|
||||
shade = overlay_shade = floorshade - 10;
|
||||
|
||||
if (TEST(psp->PlayerP->Flags, PF_VIEW_FROM_OUTSIDE))
|
||||
|
|
|
@ -1442,8 +1442,8 @@ void DoPlayerSetWadeDepth(PLAYERp pp)
|
|||
if (TEST(sectp->extra, SECTFX_SINK))
|
||||
{
|
||||
// make sure your even in the water
|
||||
if (pp->posz + PLAYER_HEIGHT > pp->lo_sectp->floorz - Z(FixedToInt(SectUser[sectnum(pp->lo_sectp)]->depth_fixed)))
|
||||
pp->WadeDepth = FixedToInt(SectUser[sectnum(pp->lo_sectp)]->depth_fixed);
|
||||
if (pp->posz + PLAYER_HEIGHT > pp->lo_sectp->floorz - Z(FixedToInt(pp->lo_sectp->u()->depth_fixed)))
|
||||
pp->WadeDepth = FixedToInt(pp->lo_sectp->u()->depth_fixed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1598,22 +1598,22 @@ void SlipSlope(PLAYERp pp)
|
|||
short ang;
|
||||
SECT_USERp sectu;
|
||||
|
||||
if (pp->cursectnum < 0 || !(sectu = SectUser[pp->cursectnum].Data()) || !TEST(sectu->flags, SECTFU_SLIDE_SECTOR) || !TEST(sector[pp->cursectnum].floorstat, FLOOR_STAT_SLOPE))
|
||||
if (pp->cursectnum < 0 || !(sectu = SectUser[pp->cursectnum].Data()) || !TEST(sectu->flags, SECTFU_SLIDE_SECTOR) || !TEST(pp->cursector()->floorstat, FLOOR_STAT_SLOPE))
|
||||
return;
|
||||
|
||||
short wallptr = sector[pp->cursectnum].wallptr;
|
||||
short wallptr = pp->cursector()->wallptr;
|
||||
|
||||
ang = getangle(wall[wall[wallptr].point2].x - wall[wallptr].x, wall[wall[wallptr].point2].y - wall[wallptr].y);
|
||||
|
||||
ang = NORM_ANGLE(ang + 512);
|
||||
|
||||
pp->xvect += MulScale(bcos(ang), sector[pp->cursectnum].floorheinum, sectu->speed);
|
||||
pp->yvect += MulScale(bsin(ang), sector[pp->cursectnum].floorheinum, sectu->speed);
|
||||
pp->xvect += MulScale(bcos(ang), pp->cursector()->floorheinum, sectu->speed);
|
||||
pp->yvect += MulScale(bsin(ang), pp->cursector()->floorheinum, sectu->speed);
|
||||
}
|
||||
|
||||
void DoPlayerHorizon(PLAYERp pp, float const horz, double const scaleAdjust)
|
||||
{
|
||||
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && TEST(sector[pp->cursectnum].floorstat, FLOOR_STAT_SLOPE);
|
||||
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && TEST(pp->cursector()->floorstat, FLOOR_STAT_SLOPE);
|
||||
pp->horizon.calcviewpitch(pp->pos.vec2, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursectnum, scaleAdjust, TEST(pp->Flags, PF_CLIMBING));
|
||||
pp->horizon.applyinput(horz, &pp->input.actions, scaleAdjust);
|
||||
}
|
||||
|
@ -1789,7 +1789,7 @@ void UpdatePlayerSprite(PLAYERp pp)
|
|||
|
||||
if (pp->sop_control)
|
||||
{
|
||||
sp->z = sector[pp->cursectnum].floorz;
|
||||
sp->z = pp->cursector()->floorz;
|
||||
ChangeActorSect(pp->Actor(), pp->cursectnum);
|
||||
}
|
||||
else if (pp->DoPlayerAction == DoPlayerCrawl)
|
||||
|
@ -2163,7 +2163,7 @@ void DoPlayerMove(PLAYERp pp)
|
|||
DoPlayerHorizon(pp, pp->input.horz, 1);
|
||||
}
|
||||
|
||||
if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA))
|
||||
if (pp->cursectnum >= 0 && TEST(pp->cursector()->extra, SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
if (TEST(pp->Flags, PF_FLYING|PF_JUMPING|PF_FALLING))
|
||||
{
|
||||
|
@ -2191,7 +2191,7 @@ void DoPlayerSectorUpdatePreMove(PLAYERp pp)
|
|||
if (sectnum < 0)
|
||||
return;
|
||||
|
||||
if (TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA))
|
||||
if (TEST(pp->cursector()->extra, SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
updatesectorz(pp->posx, pp->posy, pp->posz, §num);
|
||||
if (sectnum < 0)
|
||||
|
@ -2676,7 +2676,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
|||
|
||||
if (vel > 13000)
|
||||
{
|
||||
vec3_t hit_pos = { DIV2(x[0] + x[1]), DIV2(y[0] + y[1]), sector[pp->cursectnum].floorz - Z(10) };
|
||||
vec3_t hit_pos = { DIV2(x[0] + x[1]), DIV2(y[0] + y[1]), pp->cursector()->floorz - Z(10) };
|
||||
|
||||
hitscan(&hit_pos, pp->cursectnum,
|
||||
//pp->xvect, pp->yvect, 0,
|
||||
|
@ -3078,8 +3078,8 @@ void DoPlayerFall(PLAYERp pp)
|
|||
|
||||
if (PlayerFloorHit(pp, pp->loz - PLAYER_HEIGHT + recoil_amt))
|
||||
{
|
||||
SECT_USERp sectu = SectUser[pp->cursectnum].Data();
|
||||
SECTORp sectp = §or[pp->cursectnum];
|
||||
SECT_USERp sectu = pp->cursector()->u();
|
||||
SECTORp sectp = pp->cursector();
|
||||
|
||||
PlayerSectorBound(pp, Z(1));
|
||||
|
||||
|
@ -3430,7 +3430,7 @@ int DoPlayerWadeSuperJump(PLAYERp pp)
|
|||
unsigned i;
|
||||
//short angs[3];
|
||||
static short angs[3] = {0, 0, 0};
|
||||
int zh = sector[pp->cursectnum].floorz - Z(pp->WadeDepth) - Z(2);
|
||||
int zh = pp->cursector()->floorz - Z(pp->WadeDepth) - Z(2);
|
||||
|
||||
if (Prediction) return false; // !JIM! 8/5/97 Teleporter FAFhitscan SuperJump bug.
|
||||
|
||||
|
@ -3520,7 +3520,7 @@ void DoPlayerCrawl(PLAYERp pp)
|
|||
if (FAF_ConnectArea(pp->cursectnum))
|
||||
{
|
||||
// adjust the z
|
||||
pp->posz = sector[pp->cursectnum].ceilingz + Z(12);
|
||||
pp->posz = pp->cursector()->ceilingz + Z(12);
|
||||
}
|
||||
|
||||
DoPlayerBeginDiveNoWarp(pp);
|
||||
|
@ -3572,7 +3572,7 @@ void DoPlayerCrawl(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA))
|
||||
if (pp->cursectnum >= 0 && TEST(pp->cursector()->extra, SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
pp->posz = pp->loz - PLAYER_CRAWL_HEIGHT;
|
||||
}
|
||||
|
@ -3843,7 +3843,7 @@ int PlayerInDiveArea(PLAYERp pp)
|
|||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//Attention: This changed on 07/29/97
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
sectp = §or[pp->cursectnum];
|
||||
sectp = pp->cursector();
|
||||
//sectp = pp->lo_sectp;
|
||||
}
|
||||
else
|
||||
|
@ -4080,7 +4080,7 @@ int GetOverlapSector2(int x, int y, short *over, short *under)
|
|||
void DoPlayerWarpToUnderwater(PLAYERp pp)
|
||||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
SECT_USERp sectu = SectUser[pp->cursectnum].Data();
|
||||
SECT_USERp sectu = pp->cursector()->u();
|
||||
SPRITEp under_sp = nullptr, over_sp = nullptr;
|
||||
bool Found = false;
|
||||
short over, under;
|
||||
|
@ -4096,8 +4096,8 @@ void DoPlayerWarpToUnderwater(PLAYERp pp)
|
|||
over_sp = &actor->s();
|
||||
|
||||
if (TEST(sector[over_sp->sectnum].extra, SECTFX_DIVE_AREA) &&
|
||||
SectUser[over_sp->sectnum].Data() &&
|
||||
SectUser[over_sp->sectnum]->number == sectu->number)
|
||||
over_sp->sector()->hasU() &&
|
||||
over_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -4114,8 +4114,8 @@ void DoPlayerWarpToUnderwater(PLAYERp pp)
|
|||
under_sp = &actor->s();
|
||||
|
||||
if (TEST(sector[under_sp->sectnum].extra, SECTFX_UNDERWATER) &&
|
||||
SectUser[under_sp->sectnum].Data() &&
|
||||
SectUser[under_sp->sectnum]->number == sectu->number)
|
||||
under_sp->sector()->hasU() &&
|
||||
under_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -4155,7 +4155,7 @@ void DoPlayerWarpToUnderwater(PLAYERp pp)
|
|||
void DoPlayerWarpToSurface(PLAYERp pp)
|
||||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
SECT_USERp sectu = SectUser[pp->cursectnum].Data();
|
||||
SECT_USERp sectu = pp->cursector()->u();
|
||||
short over, under;
|
||||
|
||||
SPRITEp under_sp = nullptr, over_sp = nullptr;
|
||||
|
@ -4171,8 +4171,8 @@ void DoPlayerWarpToSurface(PLAYERp pp)
|
|||
under_sp = &actor->s();
|
||||
|
||||
if (TEST(sector[under_sp->sectnum].extra, SECTFX_UNDERWATER) &&
|
||||
SectUser[under_sp->sectnum].Data() &&
|
||||
SectUser[under_sp->sectnum]->number == sectu->number)
|
||||
under_sp->sector()->hasU() &&
|
||||
under_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -4189,8 +4189,8 @@ void DoPlayerWarpToSurface(PLAYERp pp)
|
|||
over_sp = &actor->s();
|
||||
|
||||
if (TEST(sector[over_sp->sectnum].extra, SECTFX_DIVE_AREA) &&
|
||||
SectUser[over_sp->sectnum].Data() &&
|
||||
SectUser[over_sp->sectnum]->number == sectu->number)
|
||||
over_sp->sector()->hasU() &&
|
||||
over_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -4446,7 +4446,7 @@ void DoPlayerDiveMeter(PLAYERp pp)
|
|||
void DoPlayerDive(PLAYERp pp)
|
||||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
SECT_USERp sectu = SectUser[pp->cursectnum].Data();
|
||||
SECT_USERp sectu = pp->cursector()->u();
|
||||
|
||||
// whenever your view is not in a water area
|
||||
if (pp->cursectnum < 0 || !SectorIsUnderwaterArea(pp->cursectnum))
|
||||
|
@ -4513,18 +4513,18 @@ void DoPlayerDive(PLAYERp pp)
|
|||
|
||||
if (pp->z_speed < 0 && FAF_ConnectArea(pp->cursectnum))
|
||||
{
|
||||
if (pp->posz < sector[pp->cursectnum].ceilingz + Z(10))
|
||||
if (pp->posz < pp->cursector()->ceilingz + Z(10))
|
||||
{
|
||||
int sectnum = pp->cursectnum;
|
||||
|
||||
// check for sector above to see if it is an underwater sector also
|
||||
updatesectorz(pp->posx, pp->posy, sector[pp->cursectnum].ceilingz - Z(8), §num);
|
||||
updatesectorz(pp->posx, pp->posy, pp->cursector()->ceilingz - Z(8), §num);
|
||||
|
||||
if (sectnum >= 0 && !SectorIsUnderwaterArea(sectnum))
|
||||
{
|
||||
// if not underwater sector we must surface
|
||||
// force into above sector
|
||||
pp->posz = sector[pp->cursectnum].ceilingz - Z(8);
|
||||
pp->posz = pp->cursector()->ceilingz - Z(8);
|
||||
pp->cursectnum = sectnum;
|
||||
DoPlayerStopDiveNoWarp(pp);
|
||||
DoPlayerBeginRun(pp);
|
||||
|
@ -4642,7 +4642,7 @@ int DoPlayerTestPlaxDeath(PLAYERp pp)
|
|||
void DoPlayerCurrent(PLAYERp pp)
|
||||
{
|
||||
int xvect, yvect;
|
||||
SECT_USERp sectu = SectUser[pp->cursectnum].Data();
|
||||
SECT_USERp sectu = pp->cursector()->u();
|
||||
int push_ret;
|
||||
|
||||
if (!sectu)
|
||||
|
@ -4759,7 +4759,7 @@ void DoPlayerWade(PLAYERp pp)
|
|||
{
|
||||
if (pp->KeyPressBits & SB_OPEN)
|
||||
{
|
||||
if (TEST(sector[pp->cursectnum].extra, SECTFX_OPERATIONAL))
|
||||
if (TEST(pp->cursector()->extra, SECTFX_OPERATIONAL))
|
||||
{
|
||||
pp->KeyPressBits &= ~SB_OPEN;
|
||||
DoPlayerBeginOperate(pp);
|
||||
|
@ -5927,7 +5927,7 @@ void DoPlayerDeathCheckKeys(PLAYERp pp)
|
|||
|
||||
void DoPlayerHeadDebris(PLAYERp pp)
|
||||
{
|
||||
SECTORp sectp = §or[pp->cursectnum];
|
||||
SECTORp sectp = pp->cursector();
|
||||
|
||||
if (TEST(sectp->extra, SECTFX_SINK))
|
||||
{
|
||||
|
@ -6385,13 +6385,13 @@ void DoPlayerRun(PLAYERp pp)
|
|||
{
|
||||
if ((pp->KeyPressBits & SB_OPEN) && pp->cursectnum >= 0)
|
||||
{
|
||||
if (TEST(sector[pp->cursectnum].extra, SECTFX_OPERATIONAL))
|
||||
if (TEST(pp->cursector()->extra, SECTFX_OPERATIONAL))
|
||||
{
|
||||
pp->KeyPressBits &= ~SB_OPEN;
|
||||
DoPlayerBeginOperate(pp);
|
||||
return;
|
||||
}
|
||||
else if (TEST(sector[pp->cursectnum].extra, SECTFX_TRIGGER))
|
||||
else if (TEST(pp->cursector()->extra, SECTFX_TRIGGER))
|
||||
{
|
||||
auto sActor = FindNearSprite(pp->Actor(), STAT_TRIGGER);
|
||||
if (sActor && SP_TAG5(&sActor->s()) == TRIGGER_TYPE_REMOTE_SO)
|
||||
|
@ -6454,7 +6454,7 @@ void DoPlayerRun(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
|
||||
if (TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA))
|
||||
if (TEST(pp->cursector()->extra, SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
pp->posz = pp->loz - PLAYER_HEIGHT;
|
||||
}
|
||||
|
|
|
@ -626,7 +626,7 @@ void SectorMidPoint(short sectnum, int *xmid, int *ymid, int *zmid)
|
|||
void DoSpringBoard(PLAYERp pp/*, short sectnum*/)
|
||||
{
|
||||
|
||||
pp->jump_speed = -sector[pp->cursectnum].hitag;
|
||||
pp->jump_speed = -pp->cursector()->hitag;
|
||||
DoPlayerBeginForceJump(pp);
|
||||
return;
|
||||
}
|
||||
|
@ -1900,10 +1900,10 @@ void OperateTripTrigger(PLAYERp pp)
|
|||
if (pp->cursectnum < 0)
|
||||
return;
|
||||
|
||||
SECTORp sectp = §or[pp->cursectnum];
|
||||
SECTORp sectp = pp->cursector();
|
||||
|
||||
// old method
|
||||
switch (sector[pp->cursectnum].lotag)
|
||||
switch (pp->cursector()->lotag)
|
||||
{
|
||||
// same tag for sector as for switch
|
||||
case TAG_LEVEL_EXIT_SWITCH:
|
||||
|
@ -1996,31 +1996,31 @@ void OperateTripTrigger(PLAYERp pp)
|
|||
case TAG_TRIGGER_MISSILE_TRAP:
|
||||
{
|
||||
// reset traps so they fire immediately
|
||||
DoTrapReset(sector[pp->cursectnum].hitag);
|
||||
DoTrapReset(pp->cursector()->hitag);
|
||||
break;
|
||||
}
|
||||
|
||||
case TAG_TRIGGER_EXPLODING_SECTOR:
|
||||
{
|
||||
DoMatchEverything(nullptr, sector[pp->cursectnum].hitag, -1);
|
||||
DoMatchEverything(nullptr, pp->cursector()->hitag, -1);
|
||||
break;
|
||||
}
|
||||
|
||||
case TAG_SPAWN_ACTOR_TRIGGER:
|
||||
{
|
||||
DoMatchEverything(nullptr, sector[pp->cursectnum].hitag, -1);
|
||||
DoMatchEverything(nullptr, pp->cursector()->hitag, -1);
|
||||
|
||||
sector[pp->cursectnum].hitag = 0;
|
||||
sector[pp->cursectnum].lotag = 0;
|
||||
pp->cursector()->hitag = 0;
|
||||
pp->cursector()->lotag = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case TAG_SO_EVENT_TRIGGER:
|
||||
{
|
||||
DoMatchEverything(nullptr, sector[pp->cursectnum].hitag, -1);
|
||||
DoMatchEverything(nullptr, pp->cursector()->hitag, -1);
|
||||
|
||||
sector[pp->cursectnum].hitag = 0;
|
||||
sector[pp->cursectnum].lotag = 0;
|
||||
pp->cursector()->hitag = 0;
|
||||
pp->cursector()->lotag = 0;
|
||||
|
||||
PlaySound(DIGI_REGULARSWITCH, pp, v3df_none);
|
||||
break;
|
||||
|
@ -2036,11 +2036,11 @@ void OperateContinuousTrigger(PLAYERp pp)
|
|||
if (pp->cursectnum < 0)
|
||||
return;
|
||||
|
||||
switch (sector[pp->cursectnum].lotag)
|
||||
switch (pp->cursector()->lotag)
|
||||
{
|
||||
case TAG_TRIGGER_MISSILE_TRAP:
|
||||
{
|
||||
DoTrapMatch(sector[pp->cursectnum].hitag);
|
||||
DoTrapMatch(pp->cursector()->hitag);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -2050,7 +2050,7 @@ void OperateContinuousTrigger(PLAYERp pp)
|
|||
|
||||
short PlayerTakeSectorDamage(PLAYERp pp)
|
||||
{
|
||||
SECT_USERp sectu = SectUser[pp->cursectnum].Data();
|
||||
SECT_USERp sectu = pp->cursector()->u();
|
||||
USERp u = pp->Actor()->u();
|
||||
|
||||
// the calling routine must make sure sectu exists
|
||||
|
@ -2074,10 +2074,10 @@ bool NearThings(PLAYERp pp)
|
|||
|
||||
|
||||
// Check player's current sector for triggered sound
|
||||
if (sector[pp->cursectnum].hitag == PLAYER_SOUNDEVENT_TAG)
|
||||
if (pp->cursector()->hitag == PLAYER_SOUNDEVENT_TAG)
|
||||
{
|
||||
if (pp == Player+myconnectindex)
|
||||
PlayerSound(sector[pp->cursectnum].lotag, v3df_follow|v3df_dontpan,pp);
|
||||
PlayerSound(pp->cursector()->lotag, v3df_follow|v3df_dontpan,pp);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2417,7 +2417,7 @@ void PlayerOperateEnv(PLAYERp pp)
|
|||
// Trigger operations
|
||||
//
|
||||
|
||||
switch (sector[pp->cursectnum].lotag)
|
||||
switch (pp->cursector()->lotag)
|
||||
{
|
||||
case TAG_VATOR:
|
||||
DoVatorOperate(pp, pp->cursectnum);
|
||||
|
@ -2451,7 +2451,7 @@ void PlayerOperateEnv(PLAYERp pp)
|
|||
SECT_USERp sectu;
|
||||
if (pp->cursectnum >= 0 && (sectu = SectUser[pp->cursectnum].Data()) && sectu->damage)
|
||||
{
|
||||
SECTORp sectp = §or[pp->cursectnum];
|
||||
SECTORp sectp = pp->cursector();
|
||||
if (TEST(sectu->flags, SECTFU_DAMAGE_ABOVE_SECTOR))
|
||||
{
|
||||
PlayerTakeSectorDamage(pp);
|
||||
|
@ -2481,7 +2481,7 @@ void PlayerOperateEnv(PLAYERp pp)
|
|||
{
|
||||
OperateTripTrigger(pp);
|
||||
|
||||
if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_WARP_SECTOR))
|
||||
if (pp->cursectnum >= 0 && TEST(pp->cursector()->extra, SECTFX_WARP_SECTOR))
|
||||
{
|
||||
if (!TEST(pp->Flags2, PF2_TELEPORTED))
|
||||
{
|
||||
|
|
|
@ -2145,7 +2145,7 @@ void MoveZ(SECTOR_OBJECTp sop)
|
|||
// for all sectors
|
||||
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
||||
{
|
||||
if (SectUser[sop->sector[i]].Data() && TEST(SectUser[sop->sector[i]]->flags, SECTFU_SO_DONT_BOB))
|
||||
if (sop->sectp[i]->hasU() && TEST(sop->sectp[i]->u()->flags, SECTFU_SO_DONT_BOB))
|
||||
continue;
|
||||
|
||||
(*sectp)->floorz = sop->zorig_floor[i] + sop->bob_diff;
|
||||
|
@ -2202,7 +2202,7 @@ void CallbackSOsink(ANIMp ap, void *data)
|
|||
|
||||
for (i = 0; sop->sector[i] != -1; i++)
|
||||
{
|
||||
if (SectUser[sop->sector[i]].Data() && TEST(SectUser[sop->sector[i]]->flags, SECTFU_SO_SINK_DEST))
|
||||
if (sop->sectp[i]->hasU() && TEST(sop->sectp[i]->u()->flags, SECTFU_SO_SINK_DEST))
|
||||
{
|
||||
src_sector = sop->sector[i];
|
||||
break;
|
||||
|
@ -2493,7 +2493,7 @@ void DoTrack(SECTOR_OBJECTp sop, short locktics, int *nx, int *ny)
|
|||
|
||||
for (i = 0; sop->sector[i] != -1; i++)
|
||||
{
|
||||
if (SectUser[sop->sector[i]].Data() && TEST(SectUser[sop->sector[i]]->flags, SECTFU_SO_SINK_DEST))
|
||||
if (sop->sectp[i]->hasU() && TEST(sop->sectp[i]->u()->flags, SECTFU_SO_SINK_DEST))
|
||||
{
|
||||
dest_sector = sop->sector[i];
|
||||
break;
|
||||
|
@ -2511,7 +2511,7 @@ void DoTrack(SECTOR_OBJECTp sop, short locktics, int *nx, int *ny)
|
|||
|
||||
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
||||
{
|
||||
if (SectUser[sop->sector[i]].Data() && TEST(SectUser[sop->sector[i]]->flags, SECTFU_SO_DONT_SINK))
|
||||
if (sop->sectp[i]->hasU() && TEST(sop->sectp[i]->u()->flags, SECTFU_SO_DONT_SINK))
|
||||
continue;
|
||||
|
||||
ndx = AnimSet(ANIM_Floorz, sectnum(*sectp), nullptr, sector[dest_sector].floorz, tpoint->tag_high);
|
||||
|
@ -2723,7 +2723,7 @@ void OperateSectorObjectForTics(SECTOR_OBJECTp sop, short newang, int newx, int
|
|||
// for all sectors
|
||||
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
||||
{
|
||||
if (SectUser[sop->sector[i]].Data() && TEST(SectUser[sop->sector[i]]->flags, SECTFU_SO_DONT_BOB))
|
||||
if (sop->sectp[i]->hasU() && TEST(sop->sectp[i]->u()->flags, SECTFU_SO_DONT_BOB))
|
||||
continue;
|
||||
|
||||
(*sectp)->floorz = sop->zorig_floor[i] + sop->bob_diff;
|
||||
|
|
|
@ -2762,7 +2762,7 @@ int DoLavaErupt(DSWActor* actor)
|
|||
TRAVERSE_CONNECT(pnum)
|
||||
{
|
||||
pp = Player + pnum;
|
||||
if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_TRIGGER))
|
||||
if (pp->cursectnum >= 0 && TEST(pp->cursector()->extra, SECTFX_TRIGGER))
|
||||
{
|
||||
SWSectIterator it(pp->cursectnum);
|
||||
while (auto itActor = it.Next())
|
||||
|
@ -4590,7 +4590,7 @@ int DoFireballFlames(DSWActor* actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed) > 0)
|
||||
if (sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed) > 0)
|
||||
{
|
||||
if (labs(sp->sector()->floorz - sp->z) <= Z(4))
|
||||
{
|
||||
|
@ -4665,7 +4665,7 @@ int DoBreakFlames(DSWActor* actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed) > 0)
|
||||
if (sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed) > 0)
|
||||
{
|
||||
if (labs(sp->sector()->floorz - sp->z) <= Z(4))
|
||||
{
|
||||
|
@ -8625,7 +8625,7 @@ int DoGrenade(DSWActor* actor)
|
|||
if (TEST(u->Flags, SPR_UNDERWATER))
|
||||
SET(u->Flags, SPR_BOUNCE); // no bouncing underwater
|
||||
|
||||
if (u->lo_sectp && SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed))
|
||||
if (u->lo_sectp && sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed))
|
||||
SET(u->Flags, SPR_BOUNCE); // no bouncing on shallow water
|
||||
|
||||
if (!TEST(u->Flags, SPR_BOUNCE))
|
||||
|
@ -17918,8 +17918,8 @@ bool WarpToUnderwater(short *sectnum, int *x, int *y, int *z)
|
|||
over_sp = &itActor->s();
|
||||
|
||||
if (TEST(sector[over_sp->sectnum].extra, SECTFX_DIVE_AREA) &&
|
||||
SectUser[over_sp->sectnum].Data() &&
|
||||
SectUser[over_sp->sectnum]->number == sectu->number)
|
||||
over_sp->sector()->hasU() &&
|
||||
over_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -17936,8 +17936,8 @@ bool WarpToUnderwater(short *sectnum, int *x, int *y, int *z)
|
|||
under_sp = &itActor->s();
|
||||
|
||||
if (TEST(sector[under_sp->sectnum].extra, SECTFX_UNDERWATER) &&
|
||||
SectUser[under_sp->sectnum].Data() &&
|
||||
SectUser[under_sp->sectnum]->number == sectu->number)
|
||||
under_sp->sector()->hasU() &&
|
||||
under_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -17992,8 +17992,8 @@ bool WarpToSurface(short *sectnum, int *x, int *y, int *z)
|
|||
under_sp = &itActor->s();
|
||||
|
||||
if (TEST(sector[under_sp->sectnum].extra, SECTFX_UNDERWATER) &&
|
||||
SectUser[under_sp->sectnum].Data() &&
|
||||
SectUser[under_sp->sectnum]->number == sectu->number)
|
||||
under_sp->sector()->hasU() &&
|
||||
under_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -18010,8 +18010,8 @@ bool WarpToSurface(short *sectnum, int *x, int *y, int *z)
|
|||
over_sp = &itActor->s();
|
||||
|
||||
if (TEST(sector[over_sp->sectnum].extra, SECTFX_DIVE_AREA) &&
|
||||
SectUser[over_sp->sectnum].Data() &&
|
||||
SectUser[over_sp->sectnum]->number == sectu->number)
|
||||
over_sp->sector()->hasU() &&
|
||||
over_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -18047,7 +18047,7 @@ bool SpriteWarpToUnderwater(DSWActor* actor)
|
|||
USERp u = actor->u();
|
||||
auto sp = &actor->s();
|
||||
int i;
|
||||
SECT_USERp sectu = SectUser[sp->sectnum].Data();
|
||||
SECT_USERp sectu = sp->sector()->u();
|
||||
SPRITEp under_sp = nullptr, over_sp = nullptr;
|
||||
bool Found = false;
|
||||
short over, under;
|
||||
|
@ -18064,8 +18064,8 @@ bool SpriteWarpToUnderwater(DSWActor* actor)
|
|||
over_sp = &itActor->s();
|
||||
|
||||
if (TEST(sector[over_sp->sectnum].extra, SECTFX_DIVE_AREA) &&
|
||||
SectUser[over_sp->sectnum].Data() &&
|
||||
SectUser[over_sp->sectnum]->number == sectu->number)
|
||||
over_sp->sector()->hasU() &&
|
||||
over_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -18082,8 +18082,8 @@ bool SpriteWarpToUnderwater(DSWActor* actor)
|
|||
under_sp = &itActor->s();
|
||||
|
||||
if (TEST(sector[under_sp->sectnum].extra, SECTFX_UNDERWATER) &&
|
||||
SectUser[under_sp->sectnum].Data() &&
|
||||
SectUser[under_sp->sectnum]->number == sectu->number)
|
||||
under_sp->sector()->hasU() &&
|
||||
under_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -18124,7 +18124,7 @@ bool SpriteWarpToSurface(DSWActor* actor)
|
|||
{
|
||||
USERp u = actor->u();
|
||||
auto sp = &actor->s();
|
||||
SECT_USERp sectu = SectUser[sp->sectnum].Data();
|
||||
SECT_USERp sectu = sp->sector()->u();
|
||||
short over, under;
|
||||
int sx, sy;
|
||||
|
||||
|
@ -18142,8 +18142,8 @@ bool SpriteWarpToSurface(DSWActor* actor)
|
|||
under_sp = &itActor->s();
|
||||
|
||||
if (TEST(sector[under_sp->sectnum].extra, SECTFX_UNDERWATER) &&
|
||||
SectUser[under_sp->sectnum].Data() &&
|
||||
SectUser[under_sp->sectnum]->number == sectu->number)
|
||||
under_sp->sector()->hasU() &&
|
||||
under_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -18164,8 +18164,8 @@ bool SpriteWarpToSurface(DSWActor* actor)
|
|||
over_sp = &itActor->s();
|
||||
|
||||
if (TEST(sector[over_sp->sectnum].extra, SECTFX_DIVE_AREA) &&
|
||||
SectUser[over_sp->sectnum].Data() &&
|
||||
SectUser[over_sp->sectnum]->number == sectu->number)
|
||||
over_sp->sector()->hasU() &&
|
||||
over_sp->sector()->u()->number == sectu->number)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
|
@ -18208,7 +18208,7 @@ int SpawnSplash(DSWActor* actor)
|
|||
USERp u = actor->u(), wu;
|
||||
SPRITEp sp = &actor->s(), wp;
|
||||
|
||||
SECT_USERp sectu = SectUser[sp->sectnum].Data();
|
||||
SECT_USERp sectu = sp->sector()->u();
|
||||
SECTORp sectp = sp->sector();
|
||||
|
||||
if (Prediction)
|
||||
|
@ -19337,7 +19337,7 @@ int DoShrapVelocity(DSWActor* actor)
|
|||
if (TEST(u->Flags, SPR_UNDERWATER))
|
||||
SET(u->Flags, SPR_BOUNCE); // no bouncing underwater
|
||||
|
||||
if (u->lo_sectp && SectUser[sp->sectnum].Data() && FixedToInt(SectUser[sp->sectnum]->depth_fixed))
|
||||
if (u->lo_sectp && sp->sector()->hasU() && FixedToInt(sp->sector()->u()->depth_fixed))
|
||||
SET(u->Flags, SPR_BOUNCE); // no bouncing on shallow water
|
||||
|
||||
if (!TEST(u->Flags, SPR_BOUNCE))
|
||||
|
|
|
@ -811,7 +811,7 @@ void SpawnZombie2(DSWActor* actor)
|
|||
SPRITEp sp = &actor->s();
|
||||
SPRITEp np;
|
||||
USERp nu;
|
||||
SECT_USERp sectu = SectUser[sp->sectnum].Data();
|
||||
SECT_USERp sectu = sp->sector()->u();
|
||||
SECTORp sectp = sp->sector();
|
||||
|
||||
auto ownerActor = GetOwner(actor);
|
||||
|
|
Loading…
Reference in a new issue