From 0e67b1e4086a2ff5fd4d57728eadf02a92682e7e Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:19:21 +0800 Subject: [PATCH] [saco] Implement/match `SetCarColorCrashFix()` --- saco/game/hooks.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/saco/game/hooks.cpp b/saco/game/hooks.cpp index 2b64984..9af1e59 100644 --- a/saco/game/hooks.cpp +++ b/saco/game/hooks.cpp @@ -649,6 +649,24 @@ skip: //----------------------------------------------------------- +NUDE SetCarColorCrashFix() +{ + __asm + { + test eax, eax; + jz exitFn; // CPool_CVehicle_GetAt(scmParam1) == NULL + mov ecx, 0x47eab8; + mov cl,byte ptr ds:[0xA43C7C]; // get color1 (was replaced by jmpcode) + jmp ecx; // continue function + +exitFn: + mov esi, 0x47eaca; + jmp esi; + } +} + +//----------------------------------------------------------- + NUDE GetText_Hook() { // TODO: GetText_Hook