mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 15:11:04 +00:00
- SW: Wrap calls that get PLAYER::PlayerNowPosition.Z
.
This commit is contained in:
parent
4e0aa1add1
commit
4bf202bee4
6 changed files with 52 additions and 49 deletions
|
@ -1268,7 +1268,7 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
|
||||||
updatesectorz(tpos, &tsect);
|
updatesectorz(tpos, &tsect);
|
||||||
}
|
}
|
||||||
|
|
||||||
pp->si = tpos.plusZ(-pp->PlayerNowPosition.Z);
|
pp->si = tpos.plusZ(-pp->posZget());
|
||||||
pp->siang = tang;
|
pp->siang = tang;
|
||||||
|
|
||||||
QuakeViewChange(camerapp, tpos, tang);
|
QuakeViewChange(camerapp, tpos, tang);
|
||||||
|
|
|
@ -728,6 +728,10 @@ struct PLAYER
|
||||||
{
|
{
|
||||||
PlayerNowPosition.Z += val;
|
PlayerNowPosition.Z += val;
|
||||||
}
|
}
|
||||||
|
double posZget()
|
||||||
|
{
|
||||||
|
return PlayerNowPosition.Z;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];
|
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];
|
||||||
|
|
|
@ -192,7 +192,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
||||||
|
|
||||||
if ((pp->Flags2 & PF2_INPUT_CAN_TURN_VEHICLE))
|
if ((pp->Flags2 & PF2_INPUT_CAN_TURN_VEHICLE))
|
||||||
{
|
{
|
||||||
DoPlayerTurnVehicle(pp, input.avel, pp->PlayerNowPosition.Z + 10, abs(pp->PlayerNowPosition.Z + 10 - pp->sop->floor_loz));
|
DoPlayerTurnVehicle(pp, input.avel, pp->posZget() + 10, abs(pp->posZget() + 10 - pp->sop->floor_loz));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pp->Flags2 & PF2_INPUT_CAN_TURN_TURRET))
|
if ((pp->Flags2 & PF2_INPUT_CAN_TURN_TURRET))
|
||||||
|
|
|
@ -1214,7 +1214,7 @@ DSWActor* DoPickTarget(DSWActor* actor, DAngle max_delta_ang, int skip_targets)
|
||||||
double ezhl = ActorZOfBottom(itActor) - (ActorSizeZ(itActor) * 0.25);
|
double ezhl = ActorZOfBottom(itActor) - (ActorSizeZ(itActor) * 0.25);
|
||||||
|
|
||||||
if (actor->hasU() && actor->user.PlayerP)
|
if (actor->hasU() && actor->user.PlayerP)
|
||||||
apos.Z = actor->user.PlayerP->PlayerNowPosition.Z;
|
apos.Z = actor->user.PlayerP->posZget();
|
||||||
else
|
else
|
||||||
apos.Z = ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25);
|
apos.Z = ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25);
|
||||||
|
|
||||||
|
@ -1471,7 +1471,7 @@ void DoPlayerSetWadeDepth(PLAYER* pp)
|
||||||
if ((sectp->extra & SECTFX_SINK))
|
if ((sectp->extra & SECTFX_SINK))
|
||||||
{
|
{
|
||||||
// make sure your even in the water
|
// make sure your even in the water
|
||||||
if (pp->PlayerNowPosition.Z + PLAYER_HEIGHTF > pp->lo_sectp->floorz - FixedToInt(pp->lo_sectp->depth_fixed))
|
if (pp->posZget() + PLAYER_HEIGHTF > pp->lo_sectp->floorz - FixedToInt(pp->lo_sectp->depth_fixed))
|
||||||
pp->WadeDepth = FixedToInt(pp->lo_sectp->depth_fixed);
|
pp->WadeDepth = FixedToInt(pp->lo_sectp->depth_fixed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1485,7 +1485,7 @@ void DoPlayerSetWadeDepth(PLAYER* pp)
|
||||||
|
|
||||||
void DoPlayerHeight(PLAYER* pp)
|
void DoPlayerHeight(PLAYER* pp)
|
||||||
{
|
{
|
||||||
double diff = pp->PlayerNowPosition.Z - (pp->loz - PLAYER_HEIGHTF);
|
double diff = pp->posZget() - (pp->loz - PLAYER_HEIGHTF);
|
||||||
pp->posZadd(-diff * 0.375);
|
pp->posZadd(-diff * 0.375);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1493,7 +1493,7 @@ void DoPlayerJumpHeight(PLAYER* pp)
|
||||||
{
|
{
|
||||||
if (pp->lo_sectp && (pp->lo_sectp->extra & SECTFX_DYNAMIC_AREA))
|
if (pp->lo_sectp && (pp->lo_sectp->extra & SECTFX_DYNAMIC_AREA))
|
||||||
{
|
{
|
||||||
if (pp->PlayerNowPosition.Z + PLAYER_HEIGHTF > pp->loz)
|
if (pp->posZget() + PLAYER_HEIGHTF > pp->loz)
|
||||||
{
|
{
|
||||||
pp->posZset(pp->loz - PLAYER_HEIGHTF);
|
pp->posZset(pp->loz - PLAYER_HEIGHTF);
|
||||||
DoPlayerBeginRun(pp);
|
DoPlayerBeginRun(pp);
|
||||||
|
@ -1503,7 +1503,7 @@ void DoPlayerJumpHeight(PLAYER* pp)
|
||||||
|
|
||||||
void DoPlayerCrawlHeight(PLAYER* pp)
|
void DoPlayerCrawlHeight(PLAYER* pp)
|
||||||
{
|
{
|
||||||
double diff = pp->PlayerNowPosition.Z - (pp->loz - PLAYER_CRAWL_HEIGHTF);
|
double diff = pp->posZget() - (pp->loz - PLAYER_CRAWL_HEIGHTF);
|
||||||
pp->posZadd(-diff * 0.375);
|
pp->posZadd(-diff * 0.375);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1774,7 +1774,7 @@ void DoPlayerSpriteBob(PLAYER* pp, double player_height, double bobamt, short bo
|
||||||
{
|
{
|
||||||
pp->bob_ndx = (pp->bob_ndx + (synctics << bob_speed)) & 2047;
|
pp->bob_ndx = (pp->bob_ndx + (synctics << bob_speed)) & 2047;
|
||||||
pp->pbob_amt = bobamt * BobVal(pp->bob_ndx);
|
pp->pbob_amt = bobamt * BobVal(pp->bob_ndx);
|
||||||
pp->actor->spr.pos.Z = pp->PlayerNowPosition.Z + player_height + pp->pbob_amt;
|
pp->actor->spr.pos.Z = pp->posZget() + player_height + pp->pbob_amt;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -1874,12 +1874,12 @@ void UpdatePlayerSprite(PLAYER* pp)
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerCrawl)
|
else if (pp->DoPlayerAction == DoPlayerCrawl)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->PlayerNowPosition.Z + PLAYER_CRAWL_HEIGHTF;
|
actor->spr.pos.Z = pp->posZget() + PLAYER_CRAWL_HEIGHTF;
|
||||||
ChangeActorSect(pp->actor, pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerWade)
|
else if (pp->DoPlayerAction == DoPlayerWade)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->PlayerNowPosition.Z + PLAYER_HEIGHTF;
|
actor->spr.pos.Z = pp->posZget() + PLAYER_HEIGHTF;
|
||||||
ChangeActorSect(pp->actor, pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
|
|
||||||
if (pp->WadeDepth > Z(29))
|
if (pp->WadeDepth > Z(29))
|
||||||
|
@ -1890,13 +1890,12 @@ void UpdatePlayerSprite(PLAYER* pp)
|
||||||
else if (pp->DoPlayerAction == DoPlayerDive)
|
else if (pp->DoPlayerAction == DoPlayerDive)
|
||||||
{
|
{
|
||||||
// bobbing and sprite position taken care of in DoPlayerDive
|
// bobbing and sprite position taken care of in DoPlayerDive
|
||||||
actor->spr.pos.Z = pp->PlayerNowPosition.Z + 10;
|
actor->spr.pos.Z = pp->posZget() + 10;
|
||||||
ChangeActorSect(pp->actor, pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerClimb)
|
else if (pp->DoPlayerAction == DoPlayerClimb)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->PlayerNowPosition.Z + 17;
|
actor->spr.pos.Z = pp->posZget() + 17;
|
||||||
|
|
||||||
ChangeActorSect(pp->actor, pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerFly)
|
else if (pp->DoPlayerAction == DoPlayerFly)
|
||||||
|
@ -1907,12 +1906,12 @@ void UpdatePlayerSprite(PLAYER* pp)
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerJump || pp->DoPlayerAction == DoPlayerFall || pp->DoPlayerAction == DoPlayerForceJump)
|
else if (pp->DoPlayerAction == DoPlayerJump || pp->DoPlayerAction == DoPlayerFall || pp->DoPlayerAction == DoPlayerForceJump)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->PlayerNowPosition.Z + PLAYER_HEIGHTF;
|
actor->spr.pos.Z = pp->posZget() + PLAYER_HEIGHTF;
|
||||||
ChangeActorSect(pp->actor, pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerTeleportPause)
|
else if (pp->DoPlayerAction == DoPlayerTeleportPause)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->PlayerNowPosition.Z + PLAYER_HEIGHTF;
|
actor->spr.pos.Z = pp->posZget() + PLAYER_HEIGHTF;
|
||||||
ChangeActorSect(pp->actor, pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2080,10 +2079,10 @@ void PlayerSectorBound(PLAYER* pp, double amt)
|
||||||
|
|
||||||
calcSlope(pp->cursector, pp->PlayerNowPosition, &cz, &fz);
|
calcSlope(pp->cursector, pp->PlayerNowPosition, &cz, &fz);
|
||||||
|
|
||||||
if (pp->PlayerNowPosition.Z > fz - amt)
|
if (pp->posZget() > fz - amt)
|
||||||
pp->posZset(fz - amt);
|
pp->posZset(fz - amt);
|
||||||
|
|
||||||
if (pp->PlayerNowPosition.Z < cz + amt)
|
if (pp->posZget() < cz + amt)
|
||||||
pp->posZset(cz + amt);
|
pp->posZset(cz + amt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2217,7 +2216,7 @@ void DoPlayerMove(PLAYER* pp)
|
||||||
|
|
||||||
if (interpolate_ride)
|
if (interpolate_ride)
|
||||||
{
|
{
|
||||||
pp->PlayerPrevPosition.Z = pp->PlayerNowPosition.Z;
|
pp->PlayerPrevPosition.Z = pp->posZget();
|
||||||
pp->angle.backup();
|
pp->angle.backup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2246,18 +2245,18 @@ void DoPlayerMove(PLAYER* pp)
|
||||||
{
|
{
|
||||||
if (pp->Flags & (PF_FLYING|PF_JUMPING|PF_FALLING))
|
if (pp->Flags & (PF_FLYING|PF_JUMPING|PF_FALLING))
|
||||||
{
|
{
|
||||||
if (pp->PlayerNowPosition.Z > pp->loz)
|
if (pp->posZget() > pp->loz)
|
||||||
pp->posZset(pp->loz - PLAYER_HEIGHTF);
|
pp->posZset(pp->loz - PLAYER_HEIGHTF);
|
||||||
|
|
||||||
if (pp->PlayerNowPosition.Z < pp->hiz)
|
if (pp->posZget() < pp->hiz)
|
||||||
pp->posZset(pp->hiz + PLAYER_HEIGHTF);
|
pp->posZset(pp->hiz + PLAYER_HEIGHTF);
|
||||||
}
|
}
|
||||||
else if (pp->Flags & (PF_SWIMMING|PF_DIVING))
|
else if (pp->Flags & (PF_SWIMMING|PF_DIVING))
|
||||||
{
|
{
|
||||||
if (pp->PlayerNowPosition.Z > pp->loz)
|
if (pp->posZget() > pp->loz)
|
||||||
pp->posZset(pp->loz - PLAYER_SWIM_HEIGHTF);
|
pp->posZset(pp->loz - PLAYER_SWIM_HEIGHTF);
|
||||||
|
|
||||||
if (pp->PlayerNowPosition.Z < pp->hiz)
|
if (pp->posZget() < pp->hiz)
|
||||||
pp->posZset(pp->hiz + PLAYER_SWIM_HEIGHTF);
|
pp->posZset(pp->hiz + PLAYER_SWIM_HEIGHTF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2323,10 +2322,10 @@ void DoPlayerSectorUpdatePostMove(PLAYER* pp)
|
||||||
|
|
||||||
// adjust the posz to be in a sector
|
// adjust the posz to be in a sector
|
||||||
calcSlope(pp->cursector, pp->PlayerNowPosition, &cz, &fz);
|
calcSlope(pp->cursector, pp->PlayerNowPosition, &cz, &fz);
|
||||||
if (pp->PlayerNowPosition.Z > fz)
|
if (pp->posZget() > fz)
|
||||||
pp->posZset(fz);
|
pp->posZset(fz);
|
||||||
|
|
||||||
if (pp->PlayerNowPosition.Z < cz)
|
if (pp->posZget() < cz)
|
||||||
pp->posZset(cz);
|
pp->posZset(cz);
|
||||||
|
|
||||||
// try again
|
// try again
|
||||||
|
@ -2687,7 +2686,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
||||||
pp->vect.X = pp->vect.Y = 0;
|
pp->vect.X = pp->vect.Y = 0;
|
||||||
|
|
||||||
pp->lastcursector = pp->cursector;
|
pp->lastcursector = pp->cursector;
|
||||||
double zz = pp->PlayerNowPosition.Z + 10;
|
double zz = pp->posZget() + 10;
|
||||||
|
|
||||||
DVector2 pos[4], opos[4];
|
DVector2 pos[4], opos[4];
|
||||||
|
|
||||||
|
@ -2939,12 +2938,12 @@ void DoPlayerBeginForceJump(PLAYER* pp)
|
||||||
|
|
||||||
bool PlayerCeilingHit(PLAYER* pp, double zlimit)
|
bool PlayerCeilingHit(PLAYER* pp, double zlimit)
|
||||||
{
|
{
|
||||||
return (pp->PlayerNowPosition.Z < zlimit);
|
return (pp->posZget() < zlimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerFloorHit(PLAYER* pp, double zlimit)
|
bool PlayerFloorHit(PLAYER* pp, double zlimit)
|
||||||
{
|
{
|
||||||
return (pp->PlayerNowPosition.Z > zlimit);
|
return (pp->posZget() > zlimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -3443,7 +3442,7 @@ void DoPlayerClimb(PLAYER* pp)
|
||||||
// if floor is ABOVE you && your head goes above it, do a jump up to
|
// if floor is ABOVE you && your head goes above it, do a jump up to
|
||||||
// terrace
|
// terrace
|
||||||
|
|
||||||
if (pp->PlayerNowPosition.Z < pp->LadderSector->floorz - 6)
|
if (pp->posZget() < pp->LadderSector->floorz - 6)
|
||||||
{
|
{
|
||||||
pp->jump_speed = PLAYER_CLIMB_JUMP_AMT;
|
pp->jump_speed = PLAYER_CLIMB_JUMP_AMT;
|
||||||
pp->Flags &= ~(PF_CLIMBING|PF_WEAPON_DOWN);
|
pp->Flags &= ~(PF_CLIMBING|PF_WEAPON_DOWN);
|
||||||
|
@ -3480,7 +3479,7 @@ void DoPlayerClimb(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// setsprite to players location
|
// setsprite to players location
|
||||||
plActor->spr.pos.Z = pp->PlayerNowPosition.Z + PLAYER_HEIGHTF;
|
plActor->spr.pos.Z = pp->posZget() + PLAYER_HEIGHTF;
|
||||||
ChangeActorSect(pp->actor, pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
|
|
||||||
if (!SyncInput())
|
if (!SyncInput())
|
||||||
|
@ -3556,7 +3555,7 @@ int DoPlayerWadeSuperJump(PLAYER* pp)
|
||||||
{
|
{
|
||||||
hit.hitSector = hit.hitWall->nextSector();
|
hit.hitSector = hit.hitWall->nextSector();
|
||||||
|
|
||||||
if (hit.hitSector != nullptr && abs(hit.hitSector->floorz - pp->PlayerNowPosition.Z) < 50)
|
if (hit.hitSector != nullptr && abs(hit.hitSector->floorz - pp->posZget()) < 50)
|
||||||
{
|
{
|
||||||
double dist = (pp->posXY() - hit.hitpos.XY()).Length();
|
double dist = (pp->posXY() - hit.hitpos.XY()).Length();
|
||||||
double comp = (pp->actor->clipdist + 16);
|
double comp = (pp->actor->clipdist + 16);
|
||||||
|
@ -3620,7 +3619,7 @@ void DoPlayerBeginCrawl(PLAYER* pp)
|
||||||
bool PlayerFallTest(PLAYER* pp, double player_height)
|
bool PlayerFallTest(PLAYER* pp, double player_height)
|
||||||
{
|
{
|
||||||
// If the floor is far below you, fall hard instead of adjusting height
|
// If the floor is far below you, fall hard instead of adjusting height
|
||||||
if (abs(pp->PlayerNowPosition.Z - pp->loz) > player_height + PLAYER_FALL_HEIGHTF)
|
if (abs(pp->posZget() - pp->loz) > player_height + PLAYER_FALL_HEIGHTF)
|
||||||
{
|
{
|
||||||
// if on a STEEP slope sector and you have not moved off of the sector
|
// if on a STEEP slope sector and you have not moved off of the sector
|
||||||
if (pp->lo_sectp &&
|
if (pp->lo_sectp &&
|
||||||
|
@ -3994,7 +3993,7 @@ int PlayerCanDive(PLAYER* pp)
|
||||||
pp->z_speed = 20;
|
pp->z_speed = 20;
|
||||||
pp->jump_speed = 0;
|
pp->jump_speed = 0;
|
||||||
|
|
||||||
if (pp->PlayerNowPosition.Z > pp->loz - pp->WadeDepth - 2)
|
if (pp->posZget() > pp->loz - pp->WadeDepth - 2)
|
||||||
{
|
{
|
||||||
DoPlayerBeginDive(pp);
|
DoPlayerBeginDive(pp);
|
||||||
}
|
}
|
||||||
|
@ -4687,7 +4686,7 @@ void DoPlayerDive(PLAYER* pp)
|
||||||
|
|
||||||
if (pp->z_speed < 0 && FAF_ConnectArea(pp->cursector))
|
if (pp->z_speed < 0 && FAF_ConnectArea(pp->cursector))
|
||||||
{
|
{
|
||||||
if (pp->PlayerNowPosition.Z < pp->cursector->ceilingz + 10)
|
if (pp->posZget() < pp->cursector->ceilingz + 10)
|
||||||
{
|
{
|
||||||
auto sect = pp->cursector;
|
auto sect = pp->cursector;
|
||||||
|
|
||||||
|
@ -4713,7 +4712,7 @@ void DoPlayerDive(PLAYER* pp)
|
||||||
if (sectu && (sectu->number == 0 || (sectu->flags & SECTFU_CANT_SURFACE)))
|
if (sectu && (sectu->number == 0 || (sectu->flags & SECTFU_CANT_SURFACE)))
|
||||||
{
|
{
|
||||||
// for room over room water the hiz will be the top rooms ceiling
|
// for room over room water the hiz will be the top rooms ceiling
|
||||||
if (pp->PlayerNowPosition.Z < pp->hiz + pp->p_ceiling_dist)
|
if (pp->posZget() < pp->hiz + pp->p_ceiling_dist)
|
||||||
{
|
{
|
||||||
pp->posZset(pp->hiz + pp->p_ceiling_dist);
|
pp->posZset(pp->hiz + pp->p_ceiling_dist);
|
||||||
}
|
}
|
||||||
|
@ -4724,7 +4723,7 @@ void DoPlayerDive(PLAYER* pp)
|
||||||
// !JIM! FRANK - I added !pp->hiActor so that you don't warp to surface when
|
// !JIM! FRANK - I added !pp->hiActor so that you don't warp to surface when
|
||||||
// there is a sprite above you since getzrange returns a hiz < ceiling height
|
// there is a sprite above you since getzrange returns a hiz < ceiling height
|
||||||
// if you are clipping into a sprite and not the ceiling.
|
// if you are clipping into a sprite and not the ceiling.
|
||||||
if (pp->PlayerNowPosition.Z < pp->hiz + 4 && !pp->highActor)
|
if (pp->posZget() < pp->hiz + 4 && !pp->highActor)
|
||||||
{
|
{
|
||||||
DoPlayerStopDive(pp);
|
DoPlayerStopDive(pp);
|
||||||
return;
|
return;
|
||||||
|
@ -4732,7 +4731,7 @@ void DoPlayerDive(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only get so close to the floor
|
// Only get so close to the floor
|
||||||
if (pp->PlayerNowPosition.Z >= pp->loz - PLAYER_DIVE_HEIGHTF)
|
if (pp->posZget() >= pp->loz - PLAYER_DIVE_HEIGHTF)
|
||||||
{
|
{
|
||||||
pp->posZset(pp->loz - PLAYER_DIVE_HEIGHTF);
|
pp->posZset(pp->loz - PLAYER_DIVE_HEIGHTF);
|
||||||
}
|
}
|
||||||
|
@ -4759,13 +4758,13 @@ void DoPlayerDive(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse bobbing when getting close to the floor
|
// Reverse bobbing when getting close to the floor
|
||||||
if (pp->PlayerNowPosition.Z + pp->pbob_amt >= pp->loz - PLAYER_DIVE_HEIGHTF)
|
if (pp->posZget() + pp->pbob_amt >= pp->loz - PLAYER_DIVE_HEIGHTF)
|
||||||
{
|
{
|
||||||
pp->bob_ndx = NORM_ANGLE(pp->bob_ndx + ((1024 + 512) - pp->bob_ndx) * 2);
|
pp->bob_ndx = NORM_ANGLE(pp->bob_ndx + ((1024 + 512) - pp->bob_ndx) * 2);
|
||||||
DoPlayerSpriteBob(pp, PLAYER_DIVE_HEIGHTF, PLAYER_DIVE_BOB_AMT, 3);
|
DoPlayerSpriteBob(pp, PLAYER_DIVE_HEIGHTF, PLAYER_DIVE_BOB_AMT, 3);
|
||||||
}
|
}
|
||||||
// Reverse bobbing when getting close to the ceiling
|
// Reverse bobbing when getting close to the ceiling
|
||||||
if (pp->PlayerNowPosition.Z + pp->pbob_amt < pp->hiz + pp->p_ceiling_dist)
|
if (pp->posZget() + pp->pbob_amt < pp->hiz + pp->p_ceiling_dist)
|
||||||
{
|
{
|
||||||
pp->bob_ndx = NORM_ANGLE(pp->bob_ndx + ((512) - pp->bob_ndx) * 2);
|
pp->bob_ndx = NORM_ANGLE(pp->bob_ndx + ((512) - pp->bob_ndx) * 2);
|
||||||
DoPlayerSpriteBob(pp, PLAYER_DIVE_HEIGHTF, PLAYER_DIVE_BOB_AMT, 3);
|
DoPlayerSpriteBob(pp, PLAYER_DIVE_HEIGHTF, PLAYER_DIVE_BOB_AMT, 3);
|
||||||
|
@ -5049,7 +5048,7 @@ void DoPlayerWade(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the floor is far below you, fall hard instead of adjusting height
|
// If the floor is far below you, fall hard instead of adjusting height
|
||||||
if (abs(pp->PlayerNowPosition.Z - pp->loz) > PLAYER_HEIGHTF + PLAYER_FALL_HEIGHTF)
|
if (abs(pp->posZget() - pp->loz) > PLAYER_HEIGHTF + PLAYER_FALL_HEIGHTF)
|
||||||
{
|
{
|
||||||
pp->jump_speed = 256;
|
pp->jump_speed = 256;
|
||||||
DoPlayerBeginFall(pp);
|
DoPlayerBeginFall(pp);
|
||||||
|
@ -5066,7 +5065,7 @@ void DoPlayerWade(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the floor is far below you, fall hard instead of adjusting height
|
// If the floor is far below you, fall hard instead of adjusting height
|
||||||
if (abs(pp->PlayerNowPosition.Z - pp->loz) > PLAYER_HEIGHTF + PLAYER_FALL_HEIGHTF)
|
if (abs(pp->posZget() - pp->loz) > PLAYER_HEIGHTF + PLAYER_FALL_HEIGHTF)
|
||||||
{
|
{
|
||||||
pp->jump_speed = Z(1);
|
pp->jump_speed = Z(1);
|
||||||
DoPlayerBeginFall(pp);
|
DoPlayerBeginFall(pp);
|
||||||
|
@ -6395,7 +6394,7 @@ void DoPlayerDeathDrown(PLAYER* pp)
|
||||||
actor->spr.pos.Z += 4;
|
actor->spr.pos.Z += 4;
|
||||||
|
|
||||||
// Stick like glue when you hit the ground
|
// Stick like glue when you hit the ground
|
||||||
if (pp->PlayerNowPosition.Z > pp->loz - PLAYER_DEATH_HEIGHTF)
|
if (pp->posZget() > pp->loz - PLAYER_DEATH_HEIGHTF)
|
||||||
{
|
{
|
||||||
pp->posZset(pp->loz - PLAYER_DEATH_HEIGHTF);
|
pp->posZset(pp->loz - PLAYER_DEATH_HEIGHTF);
|
||||||
pp->Flags &= ~(PF_FALLING);
|
pp->Flags &= ~(PF_FALLING);
|
||||||
|
@ -6494,7 +6493,7 @@ void DoPlayerDeathCrumble(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
DoPlayerDeathCheckKeys(pp);
|
DoPlayerDeathCheckKeys(pp);
|
||||||
plActor->spr.pos.Z = pp->PlayerNowPosition.Z + PLAYER_DEAD_HEAD_FLOORZ_OFFSET;
|
plActor->spr.pos.Z = pp->posZget() + PLAYER_DEAD_HEAD_FLOORZ_OFFSET;
|
||||||
DoPlayerHeadDebris(pp);
|
DoPlayerHeadDebris(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6553,7 +6552,7 @@ void DoPlayerDeathExplode(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
DoPlayerDeathCheckKeys(pp);
|
DoPlayerDeathCheckKeys(pp);
|
||||||
plActor->spr.pos.Z = pp->PlayerNowPosition.Z + PLAYER_DEAD_HEAD_FLOORZ_OFFSET;
|
plActor->spr.pos.Z = pp->posZget() + PLAYER_DEAD_HEAD_FLOORZ_OFFSET;
|
||||||
DoPlayerHeadDebris(pp);
|
DoPlayerHeadDebris(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7341,10 +7340,10 @@ void PlayerSpawnPosition(PLAYER* pp)
|
||||||
|
|
||||||
calcSlope(pp->cursector, pp->PlayerNowPosition, &cz, &fz);
|
calcSlope(pp->cursector, pp->PlayerNowPosition, &cz, &fz);
|
||||||
// if too close to the floor - stand up
|
// if too close to the floor - stand up
|
||||||
if (pp->PlayerNowPosition.Z > fz - PLAYER_HEIGHTF)
|
if (pp->posZget() > fz - PLAYER_HEIGHTF)
|
||||||
{
|
{
|
||||||
pp->posZset(fz - PLAYER_HEIGHTF);
|
pp->posZset(fz - PLAYER_HEIGHTF);
|
||||||
pp->PlayerPrevPosition.Z = pp->PlayerNowPosition.Z;
|
pp->PlayerPrevPosition.Z = pp->posZget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2404,7 +2404,7 @@ void PlayerOperateEnv(PLAYER* pp)
|
||||||
NearThings(pp); // Check for player sound specified in a level sprite
|
NearThings(pp); // Check for player sound specified in a level sprite
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildNearTagList(nti, sizeof(nti), pp, pp->PlayerNowPosition.Z, 128, NT_Lotag | NT_Hitag, 8);
|
BuildNearTagList(nti, sizeof(nti), pp, pp->posZget(), 128, NT_Lotag | NT_Hitag, 8);
|
||||||
|
|
||||||
found = false;
|
found = false;
|
||||||
|
|
||||||
|
|
|
@ -11500,7 +11500,7 @@ int DoRing(DSWActor* actor)
|
||||||
double z;
|
double z;
|
||||||
// move the center with the player
|
// move the center with the player
|
||||||
if (pp)
|
if (pp)
|
||||||
z = pp->PlayerNowPosition.Z + 20;
|
z = pp->posZget() + 20;
|
||||||
else
|
else
|
||||||
z = ActorZOfMiddle(own) + 30;
|
z = ActorZOfMiddle(own) + 30;
|
||||||
|
|
||||||
|
@ -11612,7 +11612,7 @@ void InitSpellRing(PLAYER* pp)
|
||||||
|
|
||||||
// put it out there
|
// put it out there
|
||||||
actorNew->spr.pos += actorNew->spr.angle.ToVector() * actorNew->user.Dist;
|
actorNew->spr.pos += actorNew->spr.angle.ToVector() * actorNew->user.Dist;
|
||||||
actorNew->spr.pos.Z += pp->PlayerNowPosition.Z + 20 - (actorNew->user.Dist * pp->horizon.horiz.Tan() * 2.); // horizon math sucks...
|
actorNew->spr.pos.Z += pp->posZget() + 20 - (actorNew->user.Dist * pp->horizon.horiz.Tan() * 2.); // horizon math sucks...
|
||||||
|
|
||||||
actorNew->spr.angle += DAngle90;
|
actorNew->spr.angle += DAngle90;
|
||||||
|
|
||||||
|
@ -15513,7 +15513,7 @@ int InitUzi(PLAYER* pp)
|
||||||
if (RANDOM_P2(1024) < 400)
|
if (RANDOM_P2(1024) < 400)
|
||||||
InitTracerUzi(pp);
|
InitTracerUzi(pp);
|
||||||
|
|
||||||
double nz = (pp->PlayerNowPosition.Z + pp->bob_z);
|
double nz = (pp->posZget() + pp->bob_z);
|
||||||
double dax = 1024.;
|
double dax = 1024.;
|
||||||
double daz = nz;
|
double daz = nz;
|
||||||
DAngle daang = DAngle22_5 / 4;
|
DAngle daang = DAngle22_5 / 4;
|
||||||
|
|
Loading…
Reference in a new issue