Skip to content

Commit

Permalink
- Exhumed: Split out player yaw code.
Browse files Browse the repository at this point in the history
* Consider where this is executed. Should it come after the Ramses check, or be performed along-side player's pitch?
  • Loading branch information
mjr4077au committed Mar 24, 2023
1 parent 9b3c726 commit 8812831
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions source/games/exhumed/src/player.cpp
Expand Up @@ -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)
{
const auto pPlayerActor = pPlayer->pActor;
Expand Down Expand Up @@ -1114,15 +1133,7 @@ void AIPlayer::Tick(RunListEvent* ev)
if (pPlayer->nQuake != 0)
doPlayerQuake(pPlayer);

pPlayer->Angles.doViewYaw(&pPlayer->input);

// loc_1A494:
if (SyncInput())
{
pPlayer->pActor->spr.Angles.Yaw += DAngle::fromDeg(pPlayer->input.avel);
}

pPlayer->Angles.doYawKeys(&pPlayer->input);
doPlayerYaw(pPlayer);

// player.zvel is modified within Gravity()
double zVel = pPlayerActor->vel.Z;
Expand Down

0 comments on commit 8812831

Please sign in to comment.