- SW: handle getzrangepoint

This commit is contained in:
Christoph Oelckers 2021-11-26 20:18:30 +01:00
parent 53be5d1622
commit 02ef323086
7 changed files with 18 additions and 22 deletions

View file

@ -1860,7 +1860,7 @@ short AnimSetVelAdj(short anim_ndx, short vel_adj);
void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SETp action, PERSONALITYp person);
void getzrangepoint(int x, int y, int z, short sectnum, int32_t* ceilz, Collision* ceilhit, int32_t* florz, Collision* florhit);
void getzrangepoint(int x, int y, int z, sectortype* sect, int32_t* ceilz, Collision* ceilhit, int32_t* florz, Collision* florhit);
Collision move_sprite(DSWActor* , int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics);
Collision move_missile(DSWActor*, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics);
DSWActor* DoPickTarget(DSWActor*, uint32_t max_delta_ang, int skip_targets);

View file

@ -3002,12 +3002,12 @@ void StackedWaterSplash(PLAYERp pp)
{
if (FAF_ConnectArea(pp->cursector))
{
auto sectnum = pp->cursector;
auto sect = pp->cursector;
auto psp = &pp->Actor()->s();
updatesectorz(pp->posx, pp->posy, SPRITEp_BOS(psp), &sectnum);
updatesectorz(pp->posx, pp->posy, SPRITEp_BOS(psp), &sect);
if (SectorIsUnderwaterArea(sectnum))
if (SectorIsUnderwaterArea(sect))
{
PlaySound(DIGI_SPLASH1, pp, v3df_dontpan);
}

View file

@ -532,7 +532,6 @@ void FAFgetzrangepoint(int32_t x, int32_t y, int32_t z, sectortype* const sect,
int32_t* hiz, Collision* ceilhit,
int32_t* loz, Collision* florhit)
{
int sectnum = ::sectnum(sect);
int foo1;
Collision foo2;
bool SkipFAFcheck;
@ -545,13 +544,13 @@ void FAFgetzrangepoint(int32_t x, int32_t y, int32_t z, sectortype* const sect,
// early out to regular routine
if (!FAF_ConnectArea(sect))
{
getzrangepoint(x, y, z, sectnum, hiz, ceilhit, loz, florhit);
getzrangepoint(x, y, z, sect, hiz, ceilhit, loz, florhit);
SectorZadjust(*ceilhit, hiz, *florhit, loz);
WaterAdjust(*florhit, loz);
return;
}
getzrangepoint(x, y, z, sectnum, hiz, ceilhit, loz, florhit);
getzrangepoint(x, y, z, sect, hiz, ceilhit, loz, florhit);
SkipFAFcheck = SectorZadjust(*ceilhit, hiz, *florhit, loz);
WaterAdjust(*florhit, loz);
@ -560,25 +559,25 @@ void FAFgetzrangepoint(int32_t x, int32_t y, int32_t z, sectortype* const sect,
if (FAF_ConnectCeiling(sect))
{
int uppersect = sectnum;
auto uppersect = sect;
int newz = *hiz - Z(2);
if (ceilhit->type == kHitSprite)
return;
updatesectorz(x, y, newz, &uppersect);
if (uppersect < 0)
if (uppersect == nullptr)
return;
getzrangepoint(x, y, newz, uppersect, hiz, ceilhit, &foo1, &foo2);
SectorZadjust(*ceilhit, hiz, trash, nullptr);
}
else if (FAF_ConnectFloor(sect) && !TEST(sect->floorstat, FLOOR_STAT_FAF_BLOCK_HITSCAN))
{
int lowersect = sectnum;
auto lowersect = sect;
int newz = *loz + Z(2);
if (florhit->type == kHitSprite)
return;
updatesectorz(x, y, newz, &lowersect);
if (lowersect < 0)
if (lowersect == nullptr)
return;
getzrangepoint(x, y, newz, lowersect, &foo1, &foo2, loz, florhit);
SectorZadjust(trash, nullptr, *florhit, loz);

View file

@ -146,7 +146,6 @@ void DoRotatorMatch(PLAYERp pp, short match, bool manual)
{
USERp fu;
SPRITEp fsp;
short sectnum;
DSWActor* firstVator = nullptr;
//RotatorSwitch(match, ON);

View file

@ -608,7 +608,7 @@ void SectorMidPoint(sectortype* sectp, int *xmid, int *ymid, int *zmid)
}
void DoSpringBoard(PLAYERp pp/*, short sectnum*/)
void DoSpringBoard(PLAYERp pp)
{
pp->jump_speed = -pp->cursector->hitag;

View file

@ -145,7 +145,6 @@ void DoSlidorMatch(PLAYERp pp, short match, bool manual)
{
USERp fu;
SPRITEp fsp;
short sectnum;
SWStatIterator it(STAT_SLIDOR);
while (auto actor = it.Next())

View file

@ -619,7 +619,6 @@ void KillActor(DSWActor* actor)
USERp u = actor->u();
int i;
unsigned stat;
short statnum,sectnum;
//extern short Zombies;
ASSERT(!Prediction);
@ -2332,7 +2331,7 @@ void SpriteSetup(void)
break;
}
getzrangepoint(sp->x, sp->y, sp->z, sp->sectnum, &ceilingz, &trash, &floorz, &trash);
getzrangepoint(sp->x, sp->y, sp->z, sp->sector(), &ceilingz, &trash, &floorz, &trash);
if (floor_vator)
{
@ -4467,7 +4466,7 @@ bool SpriteOverlapZ(DSWActor* actor_a, DSWActor* actor_b, int z_overlap)
}
void getzrangepoint(int x, int y, int z, short sectnum,
void getzrangepoint(int x, int y, int z, sectortype* sect,
int32_t* ceilz, Collision* ceilhit, int32_t* florz, Collision* florhit)
{
spritetype *spr;
@ -4476,7 +4475,7 @@ void getzrangepoint(int x, int y, int z, short sectnum,
short cstat;
char clipyou;
if (sectnum < 0)
if (sect == nullptr)
{
*ceilz = 0x80000000;
@ -4486,12 +4485,12 @@ void getzrangepoint(int x, int y, int z, short sectnum,
}
// Initialize z's and hits to the current sector's top&bottom
getzsofslope(sectnum, x, y, ceilz, florz);
ceilhit->setSector(sectnum);
florhit->setSector(sectnum);
getzsofslopeptr(sect, x, y, ceilz, florz);
ceilhit->setSector(sect);
florhit->setSector(sect);
// Go through sprites of only the current sector
SWSectIterator it(sectnum);
SWSectIterator it(sect);
while (auto itActor = it.Next())
{
spr = &itActor->s();