diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index e1b11579dd1..eb1a62deb8c 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -945,6 +945,25 @@ void CGameSA::SetVehicleBurnExplosionsEnabled(bool isEnabled) m_isVehicleBurnExplosionsEnabled = isEnabled; } +void CGameSA::SetVehicleBurnBlowUpEnabled(bool isEnabled) +{ + if (isEnabled == m_isVehicleBurnBlowUpEnabled) + return; + + if (isEnabled) + { + MemCpy((void*)0x6A72B5, "\x0F\x84\x7F\x01\x00\x00", 6); // if ( this->m_nBurnTimer > 5000.0 ) + MemCpy((void*)0x6A7166, "\x0F\x84\x87\x00\x00\x00", 6); // if ( v6 <= 5000.0 ) + } + else + { + MemSet((void*)0x6A72B5, 0x90, 6); + MemSet((void*)0x6A7166, 0x90, 6); + } + + m_isVehicleBurnBlowUpEnabled = isEnabled; +} + bool CGameSA::PerformChecks() { std::map::iterator it; diff --git a/Client/game_sa/CGameSA.h b/Client/game_sa/CGameSA.h index 7ef64b44c48..613a0daa738 100644 --- a/Client/game_sa/CGameSA.h +++ b/Client/game_sa/CGameSA.h @@ -262,6 +262,9 @@ class CGameSA : public CGame bool IsVehicleBurnExplosionsEnabled() const noexcept override { return m_isVehicleBurnExplosionsEnabled; } void SetVehicleBurnExplosionsEnabled(bool isEnabled) override; + bool IsVehicleBurnBlowUpEnabled() const noexcept override { return m_isVehicleBurnBlowUpEnabled; } + void SetVehicleBurnBlowUpEnabled(bool isEnabled) override; + unsigned long GetMinuteDuration(); void SetMinuteDuration(unsigned long ulTime); @@ -396,6 +399,7 @@ class CGameSA : public CGame bool m_isExtendedWaterCannonsEnabled{false}; bool m_isIgnoreFireStateEnabled{false}; bool m_isVehicleBurnExplosionsEnabled{true}; + bool m_isVehicleBurnBlowUpEnabled{true}; static unsigned int& ClumpOffset; diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index 7632881badd..72b3c7702ab 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -6093,6 +6093,9 @@ bool CClientGame::SetWorldSpecialProperty(const WorldSpecialProperty property, c case WorldSpecialProperty::VEHICLEBURNEXPLOSIONS: g_pGame->SetVehicleBurnExplosionsEnabled(enabled); break; + case WorldSpecialProperty::VEHICLEBURNBLOWUP: + g_pGame->SetVehicleBurnBlowUpEnabled(enabled); + break; case WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART: SetVehicleEngineAutoStartEnabled(enabled); break; @@ -6142,6 +6145,8 @@ bool CClientGame::IsWorldSpecialProperty(const WorldSpecialProperty property) return m_pVehicleManager->IsSpawnFlyingComponentEnabled(); case WorldSpecialProperty::VEHICLEBURNEXPLOSIONS: return g_pGame->IsVehicleBurnExplosionsEnabled(); + case WorldSpecialProperty::VEHICLEBURNBLOWUP: + return g_pGame->IsVehicleBurnBlowUpEnabled(); case WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART: return IsVehicleEngineAutoStartEnabled(); } @@ -6944,6 +6949,7 @@ void CClientGame::ResetWorldProperties(const ResetWorldPropsInfo& resetPropsInfo g_pGame->SetIgnoreFireStateEnabled(false); m_pVehicleManager->SetSpawnFlyingComponentEnabled(true); g_pGame->SetVehicleBurnExplosionsEnabled(true); + g_pGame->SetVehicleBurnBlowUpEnabled(true); SetVehicleEngineAutoStartEnabled(true); } diff --git a/Client/mods/deathmatch/logic/CPacketHandler.cpp b/Client/mods/deathmatch/logic/CPacketHandler.cpp index 339110ff311..19d2b99c196 100644 --- a/Client/mods/deathmatch/logic/CPacketHandler.cpp +++ b/Client/mods/deathmatch/logic/CPacketHandler.cpp @@ -2419,6 +2419,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream) g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::IGNOREFIRESTATE, wsProps.data.ignoreFireState); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::FLYINGCOMPONENTS, wsProps.data.flyingcomponents); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::VEHICLEBURNEXPLOSIONS, wsProps.data.vehicleburnexplosions); + g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::VEHICLEBURNBLOWUP, wsProps.data.vehicleburnblowup); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART, wsProps.data.vehicleEngineAutoStart); float fJetpackMaxHeight = 100; diff --git a/Client/sdk/game/CGame.h b/Client/sdk/game/CGame.h index fbaba31d4b8..d6ac9513df7 100644 --- a/Client/sdk/game/CGame.h +++ b/Client/sdk/game/CGame.h @@ -243,6 +243,9 @@ class __declspec(novtable) CGame virtual bool IsVehicleBurnExplosionsEnabled() const noexcept = 0; virtual void SetVehicleBurnExplosionsEnabled(bool isEnabled) = 0; + virtual bool IsVehicleBurnBlowUpEnabled() const noexcept = 0; + virtual void SetVehicleBurnBlowUpEnabled(bool isEnabled) = 0; + virtual CWeapon* CreateWeapon() = 0; virtual CWeaponStat* CreateWeaponStat(eWeaponType weaponType, eWeaponSkill weaponSkill) = 0; diff --git a/Server/mods/deathmatch/logic/CGame.cpp b/Server/mods/deathmatch/logic/CGame.cpp index 5807a7f3edf..1dc35428a26 100644 --- a/Server/mods/deathmatch/logic/CGame.cpp +++ b/Server/mods/deathmatch/logic/CGame.cpp @@ -265,6 +265,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti m_WorldSpecialProps[WorldSpecialProperty::IGNOREFIRESTATE] = false; m_WorldSpecialProps[WorldSpecialProperty::FLYINGCOMPONENTS] = true; m_WorldSpecialProps[WorldSpecialProperty::VEHICLEBURNEXPLOSIONS] = true; + m_WorldSpecialProps[WorldSpecialProperty::VEHICLEBURNBLOWUP] = true; m_WorldSpecialProps[WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART] = true; m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true; @@ -4459,6 +4460,7 @@ void CGame::ResetWorldProperties(const ResetWorldPropsInfo& resetPropsInfo) g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::IGNOREFIRESTATE, false); g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::FLYINGCOMPONENTS, true); g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLEBURNEXPLOSIONS, true); + g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLEBURNBLOWUP, true); g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART, true); } diff --git a/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp b/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp index aceac1b129f..a7dd215ab5e 100644 --- a/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp +++ b/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp @@ -191,6 +191,7 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const wsProps.data.ignoreFireState = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::IGNOREFIRESTATE); wsProps.data.flyingcomponents = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::FLYINGCOMPONENTS); wsProps.data.vehicleburnexplosions = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLEBURNEXPLOSIONS); + wsProps.data.vehicleburnblowup = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLEBURNBLOWUP); wsProps.data.vehicleEngineAutoStart = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART); BitStream.Write(&wsProps); diff --git a/Shared/mods/deathmatch/logic/Enums.cpp b/Shared/mods/deathmatch/logic/Enums.cpp index 8bb99db974f..4518e8bf2d5 100644 --- a/Shared/mods/deathmatch/logic/Enums.cpp +++ b/Shared/mods/deathmatch/logic/Enums.cpp @@ -119,6 +119,7 @@ ADD_ENUM(WorldSpecialProperty::TUNNELWEATHERBLEND, "tunnelweatherblend") ADD_ENUM(WorldSpecialProperty::IGNOREFIRESTATE, "ignorefirestate") ADD_ENUM(WorldSpecialProperty::FLYINGCOMPONENTS, "flyingcomponents") ADD_ENUM(WorldSpecialProperty::VEHICLEBURNEXPLOSIONS, "vehicleburnexplosions") +ADD_ENUM(WorldSpecialProperty::VEHICLEBURNBLOWUP, "vehicleburnblowup") ADD_ENUM(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART, "vehicle_engine_autostart") IMPLEMENT_ENUM_CLASS_END("world-special-property") diff --git a/Shared/mods/deathmatch/logic/Enums.h b/Shared/mods/deathmatch/logic/Enums.h index 884bb559f5c..e57b84135b4 100644 --- a/Shared/mods/deathmatch/logic/Enums.h +++ b/Shared/mods/deathmatch/logic/Enums.h @@ -96,6 +96,7 @@ enum class WorldSpecialProperty IGNOREFIRESTATE, FLYINGCOMPONENTS, VEHICLEBURNEXPLOSIONS, + VEHICLEBURNBLOWUP, VEHICLE_ENGINE_AUTOSTART, }; DECLARE_ENUM_CLASS(WorldSpecialProperty); diff --git a/Shared/sdk/net/SyncStructures.h b/Shared/sdk/net/SyncStructures.h index c30cf4ce504..e0fab48024f 100644 --- a/Shared/sdk/net/SyncStructures.h +++ b/Shared/sdk/net/SyncStructures.h @@ -2014,6 +2014,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure bool ignoreFireState : 1; bool flyingcomponents : 1; bool vehicleburnexplosions : 1; + bool vehicleburnblowup : 1; bool vehicleEngineAutoStart : 1; } data; @@ -2041,6 +2042,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure data.ignoreFireState = false; data.flyingcomponents = true; data.vehicleburnexplosions = true; + data.vehicleburnblowup = true; data.vehicleEngineAutoStart = true; } };