- Exhumed: Restore nStandHeight global and move to Player struct.

* Was dropped in 572869f502.
* Game's crouch testing necessitates that this value be pre-cached.
* Interestingly, this value is 62.5 whereas the game's view height is 55. Change in late development to make the world feel larger?
This commit is contained in:
Mitchell Richters 2023-03-26 20:05:11 +11:00
parent fd62f1fb68
commit 950f4c2c38
2 changed files with 3 additions and 2 deletions

View file

@ -72,7 +72,6 @@ int obobangle = 0, bobangle = 0;
int nLocalPlayer = 0;
Player PlayerList[kMaxPlayers];
TObjPtr<DExhumedActor*> nNetStartSprite[kMaxPlayers] = { };
double nStandHeight;
int PlayerCount;
int nNetStartSprites;
int nCurStartSprite;
@ -308,6 +307,7 @@ void RestartPlayer(int nPlayer)
pPlayer->nDeathType = 0;
pPlayer->nQuake = 0;
pPlayer->nTemperature = 0;
pPlayer->nStandHeight = GetActorHeight(pPlayerActor);
SetTorch(nPlayer, 0);
if (nNetPlayerCount)
@ -1810,7 +1810,7 @@ static void updatePlayerAction(Player* const pPlayer)
{
nextAction = 10 - (pPlayer->totalvel <= 1);
}
else if (GetActorHeight(pPlayerActor) > (pPlayerSect->floorz - pPlayerSect->ceilingz))
else if (pPlayer->nStandHeight > (pPlayerSect->floorz - pPlayerSect->ceilingz))
{
// CHECKME - confirm branching in this area is OK
// CHECKME - are we finished with 'nSector' variable at this point? if so, maybe set it to pPlayerActor->sector() so we can make this code a bit neater. Don't assume pPlayerActor->sector() == nSector here!!

View file

@ -101,6 +101,7 @@ struct Player
double nQuake;
uint8_t nPlayer;
int16_t nTemperature;
double nStandHeight;
PlayerSave sPlayerSave;
int ototalvel;
int totalvel;