From c95e4bfadb721b94c34b5c25d30a70002c50012b Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:08:13 +0800 Subject: [PATCH] [saco] Match `CEscalator__Update_Hook()` --- saco/game/hooks.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/saco/game/hooks.cpp b/saco/game/hooks.cpp index 6c5bace..f606526 100644 --- a/saco/game/hooks.cpp +++ b/saco/game/hooks.cpp @@ -485,28 +485,38 @@ NUDE CRadar__DrawMap__FindPlayerSpeed_Hook() {} NUDE CFileLoader__LoadObjectInstance_Hook() {} //----------------------------------------------------------- -// 0x858BA4 - `float g_blendDist_ = 20.0f` -// -// here two variables 0x858BA4 0x858F84 were changed, the second was needlessly overwritten -// and both were stored before the change and restored after the change -// since their value didn't change anywhere in the code, I simplified the code + +float fEscalatorCheck1; +float fEscalatorCheck2; NUDE CEscalator__Update_Hook() { __asm pushad UnFuck(0x858BA4, 4); + UnFuck(0x858F84, 4); + + fEscalatorCheck1 = *(float*)0x858BA4; + fEscalatorCheck2 = *(float*)0x858F84; + *(float*)0x858BA4 = 40.0f; + *(float*)0x858F84 = 50.0f; __asm { + popad + mov eax, 0x717D30 // CEscalator::Update call eax + + pushad } - *(float*)0x858BA4 = 20.0f; // restore original (GTASA) value - + *(float*)0x858BA4 = fEscalatorCheck1; + *(float*)0x858F84 = fEscalatorCheck2; + __asm popad + __asm ret } //-----------------------------------------------------------