From e9d2a25f7f7000c4e23f3097de23d9459cdae3bb Mon Sep 17 00:00:00 2001 From: nukeykt Date: Mon, 23 Sep 2019 04:09:50 +0900 Subject: [PATCH] Add exhumed collision emulation --- source/exhumed/src/init.cpp | 2 ++ source/exhumed/src/player.cpp | 2 +- source/exhumed/src/queen.cpp | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/exhumed/src/init.cpp b/source/exhumed/src/init.cpp index a58af830e..7909582cc 100644 --- a/source/exhumed/src/init.cpp +++ b/source/exhumed/src/init.cpp @@ -509,6 +509,8 @@ void InstallEngine() LoadPaletteLookups(); MyLoadPalette(); + + enginecompatibility_mode = ENGINECOMPATIBILITY_19950829; } void RemoveEngine() diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index 1ecccb889..ea31a2158 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -1177,7 +1177,7 @@ void FuncPlayer(int pA, int nDamage, int nRun) } // loc_1A6E4 - if (!inside(sprite[nPlayerSprite].x, sprite[nPlayerSprite].y, sprite[nPlayerSprite].sectnum)) + if (inside(sprite[nPlayerSprite].x, sprite[nPlayerSprite].y, sprite[nPlayerSprite].sectnum) != 1) { mychangespritesect(nPlayerSprite, spr_sectnum); diff --git a/source/exhumed/src/queen.cpp b/source/exhumed/src/queen.cpp index 406388692..11ff313a4 100644 --- a/source/exhumed/src/queen.cpp +++ b/source/exhumed/src/queen.cpp @@ -1051,6 +1051,9 @@ void FuncQueenHead(int a, int nDamage, int nRun) sprite[nSprite].cstat = 0x8000; + // DEMO-TODO: in disassembly angle was used without masking and thus causing OOB issue. + // This behavior probably would be needed emulated for demo compatibility + // int dx = sintable[RandomSize(11) & kAngleMask) + 512] << 10; int dx = Sin((RandomSize(11) & kAngleMask) + 512) << 10; int dy = Sin(RandomSize(11) & kAngleMask) << 10; int dz = (RandomSize(5) - RandomSize(5)) << 7;