From bb5e8df71027efe23a8ce01f394c96f91f2f4ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=8C=E3=83=AB=E3=83=9D?= <191977649@qq.com> Date: Wed, 26 Jan 2022 20:31:34 +0800 Subject: [PATCH 1/2] refactor the code to reset cheats keep constant to mta --- Client/game_sa/CGameSA.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index 44373ad27fd..b99d09c34a4 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -490,9 +490,6 @@ void CGameSA::Reset() // Restore vehicle model wheel sizes CModelInfoSA::ResetAllVehiclesWheelSizes(); - - // Reset the vehicle sun glare effect to default - CVehicleSA::SetVehiclesSunGlareEnable(false); } } @@ -664,6 +661,7 @@ void CGameSA::ResetCheats() SetMoonEasterEggEnabled(false); SetExtraAirResistanceEnabled(true); SetUnderWorldWarpEnabled(true); + CVehicleSA::SetVehiclesSunGlareEnable(false); std::map::iterator it; for (it = m_Cheats.begin(); it != m_Cheats.end(); it++) From ffcafdf0841bea9d7b49674ec65ef34093246626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=8C=E3=83=AB=E3=83=9D?= <191977649@qq.com> Date: Wed, 26 Jan 2022 20:38:25 +0800 Subject: [PATCH 2/2] fixed the wording issue --- Client/game_sa/CGameSA.cpp | 6 +++--- Client/game_sa/CVehicleSA.cpp | 4 ++-- Client/game_sa/CVehicleSA.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index b99d09c34a4..4f376e75d65 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -661,7 +661,7 @@ void CGameSA::ResetCheats() SetMoonEasterEggEnabled(false); SetExtraAirResistanceEnabled(true); SetUnderWorldWarpEnabled(true); - CVehicleSA::SetVehiclesSunGlareEnable(false); + CVehicleSA::SetVehiclesSunGlareEnabled(false); std::map::iterator it; for (it = m_Cheats.begin(); it != m_Cheats.end(); it++) @@ -738,12 +738,12 @@ void CGameSA::SetJetpackWeaponEnabled(eWeaponType weaponType, bool bEnabled) void CGameSA::SetVehicleSunGlareEnabled(bool bEnabled) { // State turning will be handled in hooks handler - CVehicleSA::SetVehiclesSunGlareEnable(bEnabled); + CVehicleSA::SetVehiclesSunGlareEnabled(bEnabled); } bool CGameSA::IsVehicleSunGlareEnabled() { - return CVehicleSA::GetVehiclesSunGlareEnable(); + return CVehicleSA::GetVehiclesSunGlareEnabled(); } bool CGameSA::PerformChecks() diff --git a/Client/game_sa/CVehicleSA.cpp b/Client/game_sa/CVehicleSA.cpp index d371f3db2f3..0ed18b85951 100644 --- a/Client/game_sa/CVehicleSA.cpp +++ b/Client/game_sa/CVehicleSA.cpp @@ -2348,12 +2348,12 @@ void CVehicleSA::StaticSetHooks() HookInstall(FUNC_CAutomobile_OnVehiclePreRender, (DWORD)HOOK_Vehicle_PreRender, 5); } -void CVehicleSA::SetVehiclesSunGlareEnable(bool bEnabled) +void CVehicleSA::SetVehiclesSunGlareEnabled(bool bEnabled) { m_bVehicleSunGlare = bEnabled; } -bool CVehicleSA::GetVehiclesSunGlareEnable() +bool CVehicleSA::GetVehiclesSunGlareEnabled() { return m_bVehicleSunGlare; } diff --git a/Client/game_sa/CVehicleSA.h b/Client/game_sa/CVehicleSA.h index 70ffd3df69b..7b4e5b05284 100644 --- a/Client/game_sa/CVehicleSA.h +++ b/Client/game_sa/CVehicleSA.h @@ -774,8 +774,8 @@ class CVehicleSA : public virtual CVehicle, public virtual CPhysicalSA const CVector* GetDummyPositions() const override { return m_dummyPositions.data(); } static void StaticSetHooks(); - static void SetVehiclesSunGlareEnable(bool bEnabled); - static bool GetVehiclesSunGlareEnable(); + static void SetVehiclesSunGlareEnabled(bool bEnabled); + static bool GetVehiclesSunGlareEnabled(); private: static void SetAutomobileDummyPosition(CAutomobileSAInterface* automobile, eVehicleDummies dummy, const CVector& position);