From ca2f1bb5564f4ec9fde640bda8b4ddeb84a58cee Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 24 Sep 2020 08:11:56 +1000 Subject: [PATCH] - Exhumed: Fix ramses/spirit head issues in `DoSpiritHead()` and clamp horizon in draw code in case for whatever reason (like before) we exceed the game's defined bounds. --- source/exhumed/src/ramses.cpp | 3 ++- source/exhumed/src/view.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/exhumed/src/ramses.cpp b/source/exhumed/src/ramses.cpp index f3a2f2647..bc17a7bfa 100644 --- a/source/exhumed/src/ramses.cpp +++ b/source/exhumed/src/ramses.cpp @@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "aistuff.h" #include "player.h" #include "mapinfo.h" +#include "ps_input.h" BEGIN_PS_NS @@ -209,7 +210,7 @@ void DoSpiritHead() { static short dimSectCount = 0; - PlayerList[0].q16horiz += PlayerList[0].q16horiz / 4; + sPlayerInput[0].actions |= SB_CENTERVIEW; TileFiles.InvalidateTile(kTileRamsesWorkTile); int totalclock = leveltime * 4; diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index a5702401f..89cb54ac6 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -348,6 +348,8 @@ void DrawView(double smoothRatio, bool sceneonly) viewz = playerZ; } + pan = clamp(pan, gi->playerHorizMin(), gi->playerHorizMax()); + nCamerax = playerX; nCameray = playerY; nCameraz = playerZ;