From f4fb51bb0853ab19933735c1f4001c63ea5eb2cf Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 13 Oct 2024 21:42:33 +0800 Subject: [PATCH] [saco] Match `CHud__DrawCrossHairs_Hook()` * Match `CPlayerPed::GetCameraMode()` --- saco/game/hooks.cpp | 15 ++------------- saco/game/playerped.h | 7 +++++++ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/saco/game/hooks.cpp b/saco/game/hooks.cpp index d438e17..a09fdc6 100644 --- a/saco/game/hooks.cpp +++ b/saco/game/hooks.cpp @@ -137,7 +137,6 @@ NUDE CHud__DrawRadar_Hook() } bool bSomeFlag = false; -BYTE bytePlayerNumber = 0; NUDE CHud__DrawCrossHairs_Hook() { __asm pushad @@ -145,9 +144,7 @@ NUDE CHud__DrawCrossHairs_Hook() bSomeFlag = false; if ( pGame && pGame->FindPlayerPed() ) { - bytePlayerNumber = pGame->FindPlayerPed()->m_bytePlayerNumber; - byteSavedCameraMode = bytePlayerNumber ? GameGetPlayerCameraMode(bytePlayerNumber) : GameGetLocalPlayerCameraMode(); - if ( byteSavedCameraMode == 53 ) + if ( pGame->FindPlayerPed()->GetCameraMode() == 53 ) { ProcessHudScaleFix(); bSomeFlag = true; @@ -167,15 +164,7 @@ NUDE CHud__DrawCrossHairs_Hook() if (bSomeFlag) { - if (bHudScaleFix) - { - *(DWORD*)0x859520 = dwHudScaleX; - *(DWORD*)0x859524 = dwHudScaleY; - *CRadar__radarHeight = 76.0; - *CRadar__radarWidth = 94.0; - bHudScaleFix = 0; - bHudScaleFix = false; - } + FUNC_100A24C0(); bSomeFlag = false; } diff --git a/saco/game/playerped.h b/saco/game/playerped.h index f779b03..58c0ee1 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -24,6 +24,13 @@ public: CAMERA_AIM * GetCurrentAim(); void SetCurrentAim(CAMERA_AIM *pAim); + BYTE GetCameraMode() { + if(!m_bytePlayerNumber) + return GameGetLocalPlayerCameraMode(); + else + return GameGetPlayerCameraMode(m_bytePlayerNumber); + }; + void HideMarker(); BYTE GetCurrentWeapon(); int GetCurrentVehicleID();