[saco] Match CHud__DrawCrossHairs_Hook()

* Match `CPlayerPed::GetCameraMode()`
This commit is contained in:
RD42 2024-10-13 21:42:33 +08:00
parent a968ac7f1a
commit f4fb51bb08
2 changed files with 9 additions and 13 deletions

View File

@ -137,7 +137,6 @@ NUDE CHud__DrawRadar_Hook()
} }
bool bSomeFlag = false; bool bSomeFlag = false;
BYTE bytePlayerNumber = 0;
NUDE CHud__DrawCrossHairs_Hook() NUDE CHud__DrawCrossHairs_Hook()
{ {
__asm pushad __asm pushad
@ -145,9 +144,7 @@ NUDE CHud__DrawCrossHairs_Hook()
bSomeFlag = false; bSomeFlag = false;
if ( pGame && pGame->FindPlayerPed() ) if ( pGame && pGame->FindPlayerPed() )
{ {
bytePlayerNumber = pGame->FindPlayerPed()->m_bytePlayerNumber; if ( pGame->FindPlayerPed()->GetCameraMode() == 53 )
byteSavedCameraMode = bytePlayerNumber ? GameGetPlayerCameraMode(bytePlayerNumber) : GameGetLocalPlayerCameraMode();
if ( byteSavedCameraMode == 53 )
{ {
ProcessHudScaleFix(); ProcessHudScaleFix();
bSomeFlag = true; bSomeFlag = true;
@ -167,15 +164,7 @@ NUDE CHud__DrawCrossHairs_Hook()
if (bSomeFlag) if (bSomeFlag)
{ {
if (bHudScaleFix) FUNC_100A24C0();
{
*(DWORD*)0x859520 = dwHudScaleX;
*(DWORD*)0x859524 = dwHudScaleY;
*CRadar__radarHeight = 76.0;
*CRadar__radarWidth = 94.0;
bHudScaleFix = 0;
bHudScaleFix = false;
}
bSomeFlag = false; bSomeFlag = false;
} }

View File

@ -24,6 +24,13 @@ public:
CAMERA_AIM * GetCurrentAim(); CAMERA_AIM * GetCurrentAim();
void SetCurrentAim(CAMERA_AIM *pAim); void SetCurrentAim(CAMERA_AIM *pAim);
BYTE GetCameraMode() {
if(!m_bytePlayerNumber)
return GameGetLocalPlayerCameraMode();
else
return GameGetPlayerCameraMode(m_bytePlayerNumber);
};
void HideMarker(); void HideMarker();
BYTE GetCurrentWeapon(); BYTE GetCurrentWeapon();
int GetCurrentVehicleID(); int GetCurrentVehicleID();