- floatified sop->floor_loz and floor_hiz

This commit is contained in:
Christoph Oelckers 2022-09-03 23:32:26 +02:00
parent 9aaae82de0
commit 079fbd340f
4 changed files with 12 additions and 12 deletions

View file

@ -1469,10 +1469,10 @@ struct SECTOR_OBJECT
z_tgt, // target z delta
z_rate, // rate at which z aproaches target
// only works for single player.
bob_diff, // bobbing difference for the frame
_floor_loz, // floor low z
_floor_hiz, // floor hi z
bob_amt, // bob amount max in z coord
bob_diff; // bobbing difference for the frame
double floor_loz, // floor low z
floor_hiz; // floor hi z
int bob_amt, // bob amount max in z coord
// end of must floatify
// variables set by mappers for drivables

View file

@ -186,7 +186,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
if ((pp->Flags2 & PF2_INPUT_CAN_TURN_VEHICLE))
{
DoPlayerTurnVehicle(pp, input.avel, pp->int_ppos().Z + Z(10), abs(pp->int_ppos().Z + Z(10) - pp->sop->_floor_loz));
DoPlayerTurnVehicle(pp, input.avel, pp->int_ppos().Z + Z(10), abs(pp->int_ppos().Z + Z(10) - pp->sop->floor_loz * worldtoint));
}
if ((pp->Flags2 & PF2_INPUT_CAN_TURN_TURRET))

View file

@ -2535,7 +2535,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), { MAXSO, MAXSO });
pp->setcursector(pp->sop->op_main_sector); // for speed
floor_dist = abs(z - pp->sop->_floor_loz);
floor_dist = abs(z - pp->sop->floor_loz * worldtoint);
if (RectClip)

View file

@ -728,11 +728,11 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
sop->zorig_floor[sop->num_sectors] += Z(FixedToInt(sect->depth_fixed));
// lowest and highest floor z's
if (sect->int_floorz() > sop->_floor_loz)
sop->_floor_loz = sect->int_floorz();
if (sect->floorz > sop->floor_loz)
sop->floor_loz = sect->floorz;
if (sect->int_floorz() < sop->_floor_hiz)
sop->_floor_hiz = sect->int_floorz();
if (sect->floorz < sop->floor_hiz)
sop->floor_hiz = sect->floorz;
sop->num_sectors++;
}
@ -948,8 +948,8 @@ void SetupSectorObject(sectortype* sectp, short tag)
sop->clipdist = 1024;
sop->target_dist = 0;
sop->turn_speed = 4;
sop->_floor_loz = -9999999;
sop->_floor_hiz = 9999999;
sop->floor_loz = -9999999;
sop->floor_hiz = 9999999;
sop->ang_tgt = sop->ang = sop->ang_moving = 0;
sop->op_main_sector = nullptr;
sop->ram_damage = 0;