- Exhumed: Split out player yaw code.

* Consider where this is executed. Should it come after the Ramses check, or be performed along-side player's pitch?
This commit is contained in:
Mitchell Richters 2023-03-24 16:15:14 +11:00
parent 9b3c726458
commit 8812831c73

View file

@ -1040,6 +1040,25 @@ static void updatePlayerAction(Player* const pPlayer)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static void doPlayerYaw(Player* const pPlayer)
{
const auto pInput = &pPlayer->input;
if (SyncInput())
{
pPlayer->pActor->spr.Angles.Yaw += DAngle::fromDeg(pInput->avel);
}
pPlayer->Angles.doYawKeys(pInput);
pPlayer->Angles.doViewYaw(pInput);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void doPlayerPitch(Player* const pPlayer) static void doPlayerPitch(Player* const pPlayer)
{ {
const auto pPlayerActor = pPlayer->pActor; const auto pPlayerActor = pPlayer->pActor;
@ -1114,15 +1133,7 @@ void AIPlayer::Tick(RunListEvent* ev)
if (pPlayer->nQuake != 0) if (pPlayer->nQuake != 0)
doPlayerQuake(pPlayer); doPlayerQuake(pPlayer);
pPlayer->Angles.doViewYaw(&pPlayer->input); doPlayerYaw(pPlayer);
// loc_1A494:
if (SyncInput())
{
pPlayer->pActor->spr.Angles.Yaw += DAngle::fromDeg(pPlayer->input.avel);
}
pPlayer->Angles.doYawKeys(&pPlayer->input);
// player.zvel is modified within Gravity() // player.zvel is modified within Gravity()
double zVel = pPlayerActor->vel.Z; double zVel = pPlayerActor->vel.Z;