- wrapped all reads to user.loz.

This commit is contained in:
Christoph Oelckers 2022-08-20 21:40:42 +02:00
parent ade20cbfe2
commit ac3f6d73e3
15 changed files with 87 additions and 85 deletions

View file

@ -304,7 +304,7 @@ void DoDebrisCurrent(DSWActor* actor)
move_sprite(actor, nx, ny, 0, actor->user.ceiling_dist, actor->user.floor_dist, 0, ACTORMOVETICS);
}
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
}
int DoActorSectorDamage(DSWActor* actor)
@ -349,7 +349,7 @@ int DoActorSectorDamage(DSWActor* actor)
}
// note that most squishing is done in vator.c
if (actor->user.lo_sectp && actor->user.hi_sectp && labs(actor->user.loz - actor->user.hiz) < (ActorSizeZ(actor) >> 1))
if (actor->user.lo_sectp && actor->user.hi_sectp && labs(actor->user.int_loz() - actor->user.hiz) < (ActorSizeZ(actor) >> 1))
{
actor->user.Health = 0;
if (SpawnShrap(actor, nullptr, WPN_NM_SECTOR_SQUISH))
@ -429,12 +429,12 @@ int DoActorDebris(DSWActor* actor)
if (actor->sector()->hasU() && FixedToInt(actor->sector()->depth_fixed) > 10) // JBF: added null check
{
actor->user.WaitTics = (actor->user.WaitTics + (ACTORMOVETICS << 3)) & 1023;
actor->set_int_z(actor->user.loz - MulScale(Z(2), bsin(actor->user.WaitTics), 14));
actor->set_int_z(actor->user.int_loz() - MulScale(Z(2), bsin(actor->user.WaitTics), 14));
}
}
else
{
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
}
return 0;
@ -514,7 +514,7 @@ void KeepActorOnFloor(DSWActor* actor)
// was swimming but have now stopped
actor->user.Flags &= ~(SPR_SWIMMING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
actor->set_int_z(actor->user.oz = actor->user.loz);
actor->set_int_z(actor->user.oz = actor->user.int_loz());
actor->backupz();
return;
}
@ -525,7 +525,7 @@ void KeepActorOnFloor(DSWActor* actor)
}
// are swimming
actor->set_int_z(actor->user.oz = actor->user.loz - Z(depth));
actor->set_int_z(actor->user.oz = actor->user.int_loz() - Z(depth));
actor->backupz();
}
else
@ -534,7 +534,7 @@ void KeepActorOnFloor(DSWActor* actor)
if (actor->user.Rot == actor->user.ActorActionSet->Run || actor->user.Rot == actor->user.ActorActionSet->Swim)
{
NewStateGroup(actor, actor->user.ActorActionSet->Swim);
actor->set_int_z(actor->user.oz = actor->user.loz - Z(depth));
actor->set_int_z(actor->user.oz = actor->user.int_loz() - Z(depth));
actor->backupz();
actor->user.Flags |= (SPR_SWIMMING);
actor->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -543,7 +543,7 @@ void KeepActorOnFloor(DSWActor* actor)
{
actor->user.Flags &= ~(SPR_SWIMMING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
actor->set_int_z(actor->user.oz = actor->user.loz);
actor->set_int_z(actor->user.oz = actor->user.int_loz());
actor->backupz();
}
}
@ -558,7 +558,7 @@ void KeepActorOnFloor(DSWActor* actor)
#if 1
if (actor->user.Flags & (SPR_MOVED))
{
actor->set_int_z(actor->user.oz = actor->user.loz);
actor->set_int_z(actor->user.oz = actor->user.int_loz());
actor->backupz();
}
else
@ -718,7 +718,7 @@ int DoActorFall(DSWActor* actor)
actor->add_int_z(actor->user.jump_speed * ACTORMOVETICS);
// Stick like glue when you hit the ground
if (actor->int_pos().Z > actor->user.loz)
if (actor->int_pos().Z > actor->user.int_loz())
{
DoActorStopFall(actor);
}
@ -728,7 +728,7 @@ int DoActorFall(DSWActor* actor)
int DoActorStopFall(DSWActor* actor)
{
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
actor->user.Flags &= ~(SPR_FALLING | SPR_JUMPING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP);
@ -867,9 +867,9 @@ int DoFall(DSWActor* actor)
actor->add_int_z(actor->user.jump_speed * ACTORMOVETICS);
// Stick like glue when you hit the ground
if (actor->int_pos().Z > actor->user.loz - actor->user.floor_dist)
if (actor->int_pos().Z > actor->user.int_loz() - actor->user.floor_dist)
{
actor->set_int_z(actor->user.loz - actor->user.floor_dist);
actor->set_int_z(actor->user.int_loz() - actor->user.floor_dist);
actor->user.Flags &= ~(SPR_FALLING);
}

View file

@ -1340,7 +1340,7 @@ Collision move_scan(DSWActor* actor, int ang, int dist, int *stopx, int *stopy,
// save off position info
auto pos = actor->spr.pos;
sang = actor->int_ang();
loz = actor->user.loz;
loz = actor->user.int_loz();
hiz = actor->user.hiz;
lowActor = actor->user.lowActor;
highActor = actor->user.highActor;

View file

@ -629,7 +629,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
}
// save off lo and hi z
loz = actor->user.loz;
loz = actor->user.int_loz();
hiz = actor->user.hiz;
// adjust loz/hiz for water depth
@ -693,7 +693,7 @@ int InitCoolgCircle(DSWActor* actor)
// z velocity
actor->user.jump_speed = 400 + RANDOM_P2(256);
if (labs(actor->user.pos.Z - actor->user.hiz) < labs(actor->user.pos.Z - actor->user.loz))
if (labs(actor->user.pos.Z - actor->user.hiz) < labs(actor->user.pos.Z - actor->user.int_loz()))
actor->user.jump_speed = -actor->user.jump_speed;
actor->user.WaitTics = (RandomRange(3)+1) * 120;
@ -773,7 +773,7 @@ int DoCoolgDeath(DSWActor* actor)
DoFindGroundPoint(actor);
// on the ground
if (actor->int_pos().Z >= actor->user.loz)
if (actor->int_pos().Z >= actor->user.int_loz())
{
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it

View file

@ -453,7 +453,7 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
}
}
if (depth && labs(actor->int_pos().Z - actor->user.loz) < Z(8))
if (depth && labs(actor->int_pos().Z - actor->user.int_loz()) < Z(8))
{
actor->add_int_z(Z(depth));
actor->user.loz = actor->int_pos().Z;

View file

@ -199,7 +199,7 @@ int DoShadowFindGroundPoint(tspritetype* tspr)
// USES TSPRITE !!!!!
auto ownerActor = static_cast<DSWActor*>(tspr->ownerActor);
Collision ceilhit, florhit;
int hiz, loz = ownerActor->user.loz;
int hiz, loz = ownerActor->user.int_loz();
ESpriteFlags save_cstat, bak_cstat;
// recursive routine to find the ground - either sector or floor sprite
@ -282,7 +282,7 @@ void DoShadows(tspriteArray& tsprites, tspritetype* tsp, int viewz, int camang)
xrepeat = tsp->xrepeat;
}
loz = ownerActor->user.loz;
loz = ownerActor->user.int_loz();
if (ownerActor->user.lowActor)
{
if (!(ownerActor->user.lowActor->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ALIGNMENT_FLOOR)))

View file

@ -452,7 +452,7 @@ int DoEelMatchPlayerZ(DSWActor* actor)
const int EEL_BOB_AMT = (Z(4));
// save off lo and hi z
loz = actor->user.loz;
loz = actor->user.int_loz();
hiz = actor->user.hiz;
// adjust loz/hiz for water depth
@ -534,7 +534,7 @@ int DoEelDeath(DSWActor* actor)
DoFindGroundPoint(actor);
// on the ground
if (actor->int_pos().Z >= actor->user.loz)
if (actor->int_pos().Z >= actor->user.int_loz())
{
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
if (RandomRange(1000) > 500)

View file

@ -930,6 +930,8 @@ struct USER
memset(&WallP, 0, sizeof(USER) - myoffsetof(USER, WallP));
}
int int_loz() const { return loz; }
//
// Variables that can be used by actors and Player
//

View file

@ -360,7 +360,7 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
}
// save off lo and hi z
loz = actor->user.loz;
loz = actor->user.int_loz();
hiz = actor->user.hiz;
// adjust loz/hiz for water depth
@ -424,7 +424,7 @@ int InitHornetCircle(DSWActor* actor)
// z velocity
actor->user.jump_speed = 200 + RANDOM_P2(128);
if (labs(actor->user.pos.Z - actor->user.hiz) < labs(actor->user.pos.Z - actor->user.loz))
if (labs(actor->user.pos.Z - actor->user.hiz) < labs(actor->user.pos.Z - actor->user.int_loz()))
actor->user.jump_speed = -actor->user.jump_speed;
actor->user.WaitTics = (RandomRange(3)+1) * 60;
@ -500,7 +500,7 @@ int DoHornetDeath(DSWActor* actor)
actor->user.floor_dist = 0;
DoBeginFall(actor);
DoFindGroundPoint(actor);
actor->user.zclip = actor->user.loz;
actor->user.zclip = actor->user.int_loz();
}
if (actor->user.Flags & (SPR_SLIDING))
@ -513,7 +513,7 @@ int DoHornetDeath(DSWActor* actor)
actor->user.coll = move_sprite(actor, nx, ny, 0L, actor->user.ceiling_dist, actor->user.floor_dist, 1, ACTORMOVETICS);
// on the ground
if (actor->int_pos().Z >= actor->user.loz)
if (actor->int_pos().Z >= actor->user.int_loz())
{
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it

View file

@ -279,9 +279,9 @@ int DoWallBloodDrip(DSWActor* actor)
actor->add_int_z(actor->spr.zvel);
}
if (actor->int_pos().Z >= actor->user.loz)
if (actor->int_pos().Z >= actor->user.int_loz())
{
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
SpawnFloorSplash(actor);
KillActor(actor);
return 0;
@ -468,7 +468,7 @@ int DoBloodSpray(DSWActor* actor)
case kHitSector:
{
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
@ -643,7 +643,7 @@ int DoPhosphorus(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -672,7 +672,7 @@ int DoPhosphorus(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
@ -849,7 +849,7 @@ int DoChemBomb(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -888,7 +888,7 @@ int DoChemBomb(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
@ -1064,7 +1064,7 @@ int DoCaltrops(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -1094,7 +1094,7 @@ int DoCaltrops(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing

View file

@ -5631,7 +5631,7 @@ void DoPlayerDeathZrange(PLAYER* pp)
DoFindGround(pp->actor);
// update player values with results from DoFindGround
pp->loz = plActor->user.loz;
pp->loz = plActor->user.int_loz();
pp->lowActor = plActor->user.lowActor;
pp->lo_sectp = plActor->user.lo_sectp;
}

View file

@ -232,9 +232,9 @@ int SetupSkull(DSWActor* actor)
actor->user.Radius = 400;
if (ActorZOfBottom(actor) > actor->user.loz - Z(16))
if (ActorZOfBottom(actor) > actor->user.int_loz() - Z(16))
{
actor->set_int_z(actor->user.loz + Z(tileTopOffset(actor->spr.picnum)));
actor->set_int_z(actor->user.int_loz() + Z(tileTopOffset(actor->spr.picnum)));
actor->user.loz = actor->int_pos().Z;
// leave 8 pixels above the ground
@ -373,9 +373,9 @@ int DoSkullJump(DSWActor* actor)
return 0;
}
if ((actor->int_pos().Z > actor->user.loz - Z(36)))
if ((actor->int_pos().Z > actor->user.int_loz() - Z(36)))
{
actor->set_int_z(actor->user.loz - Z(36));
actor->set_int_z(actor->user.int_loz() - Z(36));
UpdateSinglePlayKills(actor);
DoSkullBeginDeath(actor);
return 0;
@ -439,7 +439,7 @@ int DoSkullWait(DSWActor* actor)
}
// below the floor type
if (actor->int_pos().Z > actor->user.loz)
if (actor->int_pos().Z > actor->user.int_loz())
{
// look for closest player every once in a while
if (dist < 3500)
@ -617,9 +617,9 @@ int SetupBetty(DSWActor* actor)
actor->user.Radius = 400;
if (ActorZOfBottom(actor) > actor->user.loz - Z(16))
if (ActorZOfBottom(actor) > actor->user.int_loz() - Z(16))
{
actor->set_int_z(actor->user.loz + Z(tileTopOffset(actor->spr.picnum)));
actor->set_int_z(actor->user.int_loz() + Z(tileTopOffset(actor->spr.picnum)));
actor->user.loz = actor->int_pos().Z;
// leave 8 pixels above the ground
@ -751,9 +751,9 @@ int DoBettyJump(DSWActor* actor)
return 0;
}
if ((actor->int_pos().Z > actor->user.loz - Z(36)))
if ((actor->int_pos().Z > actor->user.int_loz() - Z(36)))
{
actor->set_int_z(actor->user.loz - Z(36));
actor->set_int_z(actor->user.int_loz() - Z(36));
UpdateSinglePlayKills(actor);
DoBettyBeginDeath(actor);
return 0;
@ -811,7 +811,7 @@ int DoBettyWait(DSWActor* actor)
}
// below the floor type
if (actor->int_pos().Z > actor->user.loz)
if (actor->int_pos().Z > actor->user.int_loz())
{
// look for closest player every once in a while
if (dist < 3500)

View file

@ -4483,7 +4483,7 @@ void DoActorZrange(DSWActor* actor)
}
}
// !AIC - puts getzrange results into USER varaible actor->user.loz, actor->user.hiz, actor->user.lo_sectp, actor->user.hi_sectp, etc.
// !AIC - puts getzrange results into USER varaible actor->user.int_loz(). actor->user.hiz, actor->user.lo_sectp, actor->user.hi_sectp, etc.
// The loz and hiz are used a lot.
int DoActorGlobZ(DSWActor* actor)
@ -4618,7 +4618,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
// save off x,y values
auto apos = actor->spr.pos;
loz = actor->user.loz;
loz = actor->user.int_loz();
hiz = actor->user.hiz;
lowActor = actor->user.lowActor;
highActor = actor->user.highActor;
@ -4638,7 +4638,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
{
// cancel move
actor->spr.pos = apos;
//actor->spr.z = actor->user.loz; // place on ground in case you are in the air
//actor->spr.z = actor->user.int_loz(); // place on ground in case you are in the air
actor->user.loz = loz;
actor->user.hiz = hiz;
actor->user.lowActor = lowActor;
@ -4654,7 +4654,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
{
// cancel move
actor->spr.pos = apos;
//actor->spr.z = actor->user.loz; // place on ground in case you are in the air
//actor->spr.z = actor->user.int_loz(); // place on ground in case you are in the air
actor->user.loz = loz;
actor->user.hiz = hiz;
actor->user.lowActor = lowActor;
@ -6272,7 +6272,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
actor->spr.cstat = tempstat;
// !AIC - puts getzrange results into USER varaible actor->user.loz, actor->user.hiz, actor->user.lo_sectp, actor->user.hi_sectp, etc.
// !AIC - puts getzrange results into USER varaible actor->user.int_loz(). actor->user.hiz, actor->user.lo_sectp, actor->user.hi_sectp, etc.
// Takes info from global variables
DoActorGlobZ(actor);
@ -6476,9 +6476,9 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
if (retval.type == kHitNone)
retval.setSector(dasect);
}
else if (clippos.Z - zh > actor->user.loz - flordist)
else if (clippos.Z - zh > actor->user.int_loz() - flordist)
{
actor->set_int_z(actor->user.loz + zh - flordist);
actor->set_int_z(actor->user.int_loz() + zh - flordist);
if (retval.type == kHitNone)
retval.setSector(dasect);
}
@ -6614,9 +6614,9 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
actor->user.hi_sectp = actor->user.lo_sectp = actor->sector();
actor->user.highActor = nullptr; actor->user.lowActor = nullptr;
actor->set_int_z(actor->user.loz - Z(8));
actor->set_int_z(actor->user.int_loz() - Z(8));
if (labs(actor->user.hiz - actor->user.loz) < Z(12))
if (labs(actor->user.hiz - actor->user.int_loz()) < Z(12))
{
// we've gone into a very small place - kill it
retval.setVoid();

View file

@ -3345,7 +3345,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
actor->spr.cstat |= (CSTAT_SPRITE_YCENTER);
bos_z = ActorZOfBottom(actor);
if (bos_z > actor->user.loz)
if (bos_z > actor->user.int_loz())
{
actor->user.pos.Y = (bos_z - actor->int_pos().Z);
actor->add_int_z(-actor->user.pos.Y);

View file

@ -3813,7 +3813,7 @@ int DoVomit(DSWActor* actor)
ChangeState(actor, s_VomitSplash);
DoFindGroundPoint(actor);
MissileWaterAdjust(actor);
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
actor->user.WaitTics = 60;
actor->user.pos.X = actor->spr.xrepeat;
actor->user.pos.Y = actor->spr.yrepeat;
@ -4263,7 +4263,7 @@ bool WeaponMoveHit(DSWActor* actor)
ASSERT(sectp->extra != -1);
// hit floor - closer to floor than ceiling
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
// hit a floor sprite
if (actor->user.lowActor)
@ -7398,7 +7398,7 @@ int DoStar(DSWActor* actor)
DoActorZrange(actor);
MissileWaterAdjust(actor);
if (actor->int_pos().Z > actor->user.loz)
if (actor->int_pos().Z > actor->user.int_loz())
{
KillActor(actor);
return true;
@ -7481,7 +7481,7 @@ int DoStar(DSWActor* actor)
bool did_hit_wall;
auto hit_sect = actor->user.coll.hitSector;
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
if (hit_sect->hasU() && FixedToInt(hit_sect->depth_fixed) > 0)
{
@ -7511,7 +7511,7 @@ int DoStar(DSWActor* actor)
actor->user.change.X = MulScale(actor->user.change.X, 64000 + (RandomRange(64000) - 32000), 16);
actor->user.change.Y = MulScale(actor->user.change.Y, 64000 + (RandomRange(64000) - 32000), 16);
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
actor->user.change.Z = MulScale(actor->user.change.Z, 50000, 16); // floor
else
actor->user.change.Z = MulScale(actor->user.change.Z, 40000, 16); // ceiling
@ -7553,7 +7553,7 @@ int DoStar(DSWActor* actor)
// 32000 to 96000
actor->user.change.X = MulScale(actor->user.change.X, 64000 + (RandomRange(64000) - 32000), 16);
actor->user.change.Y = MulScale(actor->user.change.Y, 64000 + (RandomRange(64000) - 32000), 16);
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
actor->user.change.Z = MulScale(actor->user.change.Z, 50000, 16); // floor
else
actor->user.change.Z = MulScale(actor->user.change.Z, 40000, 16); // ceiling
@ -8303,7 +8303,7 @@ int DoGrenade(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -8339,7 +8339,7 @@ int DoGrenade(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing underwater
@ -8502,7 +8502,7 @@ int DoVulcanBoulder(DSWActor* actor)
else
{
// hit a sloped sector
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
// hit a floor
actor->user.change.X = MulScale(actor->user.change.X, 30000, 16);
@ -8527,7 +8527,7 @@ int DoVulcanBoulder(DSWActor* actor)
else
{
// hit unsloped floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
actor->user.coll.setNone();
actor->user.Counter = 0;
@ -8855,7 +8855,7 @@ int DoMine(DSWActor* actor)
else if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR))
{
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
actor->user.Flags2 |= (SPR2_ATTACH_FLOOR);
else
actor->user.Flags2 |= (SPR2_ATTACH_CEILING);
@ -8907,7 +8907,7 @@ int DoMine(DSWActor* actor)
SetMineStuck(actor);
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
actor->user.Flags2 |= (SPR2_ATTACH_FLOOR);
else
actor->user.Flags2 |= (SPR2_ATTACH_CEILING);
@ -10394,9 +10394,9 @@ void SpawnExpZadjust(DSWActor* actor, DSWActor* expActor, int upper_zsize, int l
expActor->set_int_z(actor->user.hiz + upper_zsize);
expActor->spr.cstat |= (CSTAT_SPRITE_YFLIP);
}
else if (bos_z > actor->user.loz)
else if (bos_z > actor->user.int_loz())
{
expActor->set_int_z(actor->user.loz - lower_zsize);
expActor->set_int_z(actor->user.int_loz() - lower_zsize);
}
}
else
@ -10809,7 +10809,7 @@ int DoNapalm(DSWActor* actor)
DoFindGroundPoint(expActor);
MissileWaterAdjust(expActor);
expActor->set_int_z(expActor->user.loz);
expActor->set_int_z(expActor->user.int_loz());
expActor->backupz();
if (actor->user.Flags & (SPR_UNDERWATER))
@ -14600,9 +14600,9 @@ int DoCoolgDrip(DSWActor* actor)
actor->user.Counter += 220;
actor->add_int_z(actor->user.Counter);
if (actor->int_pos().Z > actor->user.loz - actor->user.floor_dist)
if (actor->int_pos().Z > actor->user.int_loz() - actor->user.floor_dist)
{
actor->set_int_z(actor->user.loz - actor->user.floor_dist);
actor->set_int_z(actor->user.int_loz() - actor->user.floor_dist);
actor->spr.yrepeat = actor->spr.xrepeat = 32;
ChangeState(actor, s_GoreFloorSplash);
if (actor->user.spal == PALETTE_BLUE_LIGHTING)
@ -16989,7 +16989,7 @@ int SpawnSplash(DSWActor* actor)
DoActorZrange(actor);
MissileWaterAdjust(actor);
auto actorNew = SpawnActor(STAT_MISSILE, SPLASH, s_Splash, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.loz, actor->int_ang(), 0);
auto actorNew = SpawnActor(STAT_MISSILE, SPLASH, s_Splash, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.int_loz(), actor->int_ang(), 0);
if (sectu && (sectp->extra & SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA)
actorNew->user.spal = actorNew->spr.pal = PALETTE_RED_LIGHTING;
@ -17043,7 +17043,7 @@ bool MissileHitDiveArea(DSWActor* actor)
if (SpriteInDiveArea(actor))
{
// make sure you are close to the floor
if (actor->int_pos().Z < ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z < ((actor->user.hiz + actor->user.int_loz()) >> 1))
return false;
// Check added by Jim because of sprite bridge over water
@ -17060,7 +17060,7 @@ bool MissileHitDiveArea(DSWActor* actor)
else if (SpriteInUnderwaterArea(actor))
{
// make sure you are close to the ceiling
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
return false;
actor->user.Flags &= ~(SPR_UNDERWATER);
@ -17952,7 +17952,7 @@ int DoShrapVelocity(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -17981,9 +17981,9 @@ int DoShrapVelocity(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing underwater
@ -18254,9 +18254,9 @@ int DoItemFly(DSWActor* actor)
case kHitSector:
{
// hit floor
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.loz) >> 1))
if (actor->int_pos().Z > ((actor->user.hiz + actor->user.int_loz()) >> 1))
{
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
actor->user.Counter = 0;
actor->spr.xvel = 0;
actor->user.change.Z = actor->user.change.X = actor->user.change.Y = 0;

View file

@ -636,10 +636,10 @@ int NullZilla(DSWActor* actor)
#if 0
if (actor->user.State == s_ZillaDie)
{
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->spr.y, &actor->user.hiz, &actor->user.loz);
getzsofslopeptr(actor->sector(), actor->int_pos().X, actor->spr.y, &actor->user.hiz, &actor->user.int_loz());
actor->user.lo_sectp = actor->sector();
actor->user.hi_sectp = actor->sector();
actor->spr.z = actor->user.loz;
actor->spr.z = actor->user.int_loz();
}
#endif
@ -648,7 +648,7 @@ int NullZilla(DSWActor* actor)
actor->user.hi_sectp = actor->sector();
actor->user.lowActor = nullptr;
actor->user.highActor = nullptr;
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
DoActorSectorDamage(actor);
@ -717,7 +717,7 @@ int DoZillaDeathMelt(DSWActor* actor)
actor->user.hi_sectp = actor->sector();
actor->user.lowActor = nullptr;
actor->user.highActor = nullptr;
actor->set_int_z(actor->user.loz);
actor->set_int_z(actor->user.int_loz());
BossSpriteNum[2] = nullptr;
return 0;