diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 26d61fb77..357febc07 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -39,18 +39,6 @@ struct PlayerHorizon } } - void addadjustment(fixed_t value) - { - if (!SyncInput()) - { - adjustment += value; - } - else - { - horiz += q16horiz(value); - } - } - void resetadjustment() { adjustment = 0; diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index fa1e78fb6..2ecc79293 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -1167,29 +1167,28 @@ void FuncPlayer(int a, int nDamage, int nRun) } sectdone: - static bool plrFalling = false; - if (!PlayerList[nPlayer].horizon.horiz.asbuild() || plrFalling) + if (!bUnderwater || !PlayerList[nPlayer].horizon.horiz.asbuild() || PlayerList[nPlayer].bIsFalling) { // Calculate base pan amount based on how much the player is falling. fixed_t dVertPan = (spr_z - sprite[nPlayerSprite].z) << 9; - if (dVertPan != 0) + if (!bUnderwater && dVertPan != 0) { fixed_t adjustment; if (dVertPan >= IntToFixed(4)) - adjustment = IntToFixed(4); + adjustment = 4; else if (dVertPan <= -IntToFixed(4)) - adjustment = -IntToFixed(4); + adjustment = -4; else adjustment = dVertPan << 1; PlayerList[nPlayer].horizon.addadjustment(adjustment); - plrFalling = true; + PlayerList[nPlayer].bIsFalling = true; } else { sPlayerInput[nPlayer].actions |= SB_CENTERVIEW; - plrFalling = false; + PlayerList[nPlayer].bIsFalling = false; } } @@ -2854,6 +2853,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Player& w, Player* ("field38", w.field_38) ("field3a", w.field_3A) ("field3c", w.field_3C) + ("bIsFalling", w.bIsFalling) ("seq", w.nSeq) ("horizon", w.horizon) ("angle", w.angle) diff --git a/source/exhumed/src/player.h b/source/exhumed/src/player.h index 254796ae0..d0d915757 100644 --- a/source/exhumed/src/player.h +++ b/source/exhumed/src/player.h @@ -71,6 +71,7 @@ struct Player short field_3A; short field_3C; short nRun; + bool bIsFalling; PlayerHorizon horizon; PlayerAngle angle;