From 0edc69c2695351c087ddf72ace5c616e754a53d2 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 5 Jan 2024 21:28:05 +1100 Subject: [PATCH] - Exhumed: Tidy up `doPlayerVertPanning()` setup. --- source/games/exhumed/src/player.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index ad8e9ee020..079834dac5 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1533,13 +1533,14 @@ static void doPlayerGravity(DExhumedActor* const pPlayerActor) // //--------------------------------------------------------------------------- -static void doPlayerCameraEffects(DExhumedPlayer* const pPlayer, const double nDestVertPan) +static void doPlayerCameraEffects(DExhumedPlayer* const pPlayer, const double zDelta) { const auto pPlayerActor = pPlayer->GetActor(); const auto nUnderwater = !!(pPlayerActor->sector()->Flag & kSectUnderwater); // Pitch tilting when player's Z changes (stairs, jumping, etc). - doPlayerVertPanning(pPlayer, nDestVertPan * cl_slopetilting); + // This should amplified 8x, not 2x, but it feels very heavy. Add a CVAR? + doPlayerVertPanning(pPlayer, zDelta * 2 * cl_slopetilting); // Roll tilting effect, either console or Quake-style. pPlayer->doRollInput(nUnderwater); @@ -1813,13 +1814,12 @@ static bool doPlayerInput(DExhumedPlayer* const pPlayer) doPlayerMovingBlocks(pPlayer, nMove, spr_vel, spr_sect); } - const auto posdelta = pPlayerActor->opos - pPlayerActor->spr.pos; + const auto posdelta = pPlayerActor->spr.pos - pPlayerActor->opos; pPlayer->ototalvel = pPlayer->totalvel; pPlayer->totalvel = posdelta.XY().Length(); // Effects such as slope tilting, view bobbing, etc. - // This should amplified 8x, not 2x, but it feels very heavy. Add a CVAR? - doPlayerCameraEffects(pPlayer, -posdelta.Z * 2.); + doPlayerCameraEffects(pPlayer, posdelta.Z); // Most-move updates. Input bit funcs are here because // updatePlayerAction() needs access to bUnderwater.