From e294631afb5fc16023887aa2e19a853fb92f8df1 Mon Sep 17 00:00:00 2001 From: samr46 Date: Sat, 9 Sep 2023 13:53:05 +0300 Subject: [PATCH 1/2] Reset world special properties on client side (partially reverts 938b306) --- Client/game_sa/CGameSA.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index addcd33d96..a1d7b7cdbd 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -568,12 +568,18 @@ bool CGameSA::SetCheatEnabled(const char* szCheatName, bool bEnable) void CGameSA::ResetCheats() { - // Reset cheats that can't be set by setWorldSpecialPropertyEnabled + SetRandomFoliageEnabled(true); + SetMoonEasterEggEnabled(false); + SetExtraAirResistanceEnabled(true); + SetUnderWorldWarpEnabled(true); + SetCoronaZTestEnabled(true); + CVehicleSA::SetVehiclesSunGlareEnabled(false); + SetWaterCreaturesEnabled(true); + SetBurnFlippedCarsEnabled(true); + std::map::iterator it; for (it = m_Cheats.begin(); it != m_Cheats.end(); it++) { - if (it->second->m_bCanBeSet) - continue; if (it->second->m_byAddress > (BYTE*)0x8A4000) MemPutFast(it->second->m_byAddress, 0); else From 23f83b65c7eedd11115e1071a330e54743a1ddfa Mon Sep 17 00:00:00 2001 From: samr46 Date: Sat, 9 Sep 2023 18:28:09 +0300 Subject: [PATCH 2/2] Set default states for all properties in sync structure --- Client/game_sa/CGameSA.cpp | 12 +++--------- Shared/sdk/net/SyncStructures.h | 8 +++++++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index a1d7b7cdbd..addcd33d96 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -568,18 +568,12 @@ bool CGameSA::SetCheatEnabled(const char* szCheatName, bool bEnable) void CGameSA::ResetCheats() { - SetRandomFoliageEnabled(true); - SetMoonEasterEggEnabled(false); - SetExtraAirResistanceEnabled(true); - SetUnderWorldWarpEnabled(true); - SetCoronaZTestEnabled(true); - CVehicleSA::SetVehiclesSunGlareEnabled(false); - SetWaterCreaturesEnabled(true); - SetBurnFlippedCarsEnabled(true); - + // Reset cheats that can't be set by setWorldSpecialPropertyEnabled std::map::iterator it; for (it = m_Cheats.begin(); it != m_Cheats.end(); it++) { + if (it->second->m_bCanBeSet) + continue; if (it->second->m_byAddress > (BYTE*)0x8A4000) MemPutFast(it->second->m_byAddress, 0); else diff --git a/Shared/sdk/net/SyncStructures.h b/Shared/sdk/net/SyncStructures.h index 74b3758bc8..8176655d63 100644 --- a/Shared/sdk/net/SyncStructures.h +++ b/Shared/sdk/net/SyncStructures.h @@ -2070,10 +2070,16 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure SWorldSpecialPropertiesStateSync() { - // Override default values (default = false) + // Set default states + data.hovercars = false; + data.aircars = false; + data.extrabunny = false; + data.extrajump = false; data.randomfoliage = true; + data.snipermoon = false; data.extraairresistance = true; data.underworldwarp = true; + data.vehiclesunglare = false; data.coronaztest = true; data.watercreatures = true; data.burnflippedcars = true;