From fe3c24967d843f4c79ec40e4833efb60e60f38ca Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:08:30 +0800 Subject: [PATCH] [saco] Implement/match `CGame::DisableEnterExits()` --- saco/game/game.cpp | 23 +++++++++++++++++++++++ saco/game/game.h | 1 + 2 files changed, 24 insertions(+) diff --git a/saco/game/game.cpp b/saco/game/game.cpp index dfdd9c4..92f0097 100644 --- a/saco/game/game.cpp +++ b/saco/game/game.cpp @@ -959,3 +959,26 @@ void CGame::EnableStuntBonus(bool bEnable) //----------------------------------------------------------- +void CGame::DisableEnterExits() +{ + DWORD pEnExPool = *(DWORD *)0x96A7D8; + DWORD pEnExEntries = *(DWORD *)pEnExPool; + + int iNumEnEx=0; + int x=0; + + _asm mov ecx, pEnExPool + _asm mov eax, [ecx+8] + _asm mov iNumEnEx, eax + + BYTE *pEnExPoolSlot; + while(x!=iNumEnEx) { + pEnExPoolSlot = (((BYTE *)pEnExEntries) + (60*x)); + _asm mov eax, pEnExPoolSlot + _asm and word ptr [eax+48], 0 + x++; + } +} + +//----------------------------------------------------------- + diff --git a/saco/game/game.h b/saco/game/game.h index 1df9050..b25f02e 100644 --- a/saco/game/game.h +++ b/saco/game/game.h @@ -108,6 +108,7 @@ public: int GetScreenHeight() { return *(int*)0xC17048; }; DWORD GetWeaponInfo(int iWeapon, int iUnk); + void DisableEnterExits(); CGame();