Skip to content

Commit 1834c60

Browse files
committed
Move vehicle blow up property separated from vehicleburnexplosions
1 parent 3632088 commit 1834c60

File tree

10 files changed

+39
-3
lines changed

10 files changed

+39
-3
lines changed

Client/game_sa/CGameSA.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -934,18 +934,33 @@ void CGameSA::SetVehicleBurnExplosionsEnabled(bool isEnabled)
934934
{
935935
MemCpy((void*)0x6A74EA, "\xE8\x61\xF5\x08\x00", 5); // CAutomobile::ProcessCarOnFireAndExplode
936936
MemCpy((void*)0x737929, "\xE8\x22\xF1\xFF\xFF", 5); // CExplosion::Update
937-
MemCpy((void*)0x6A72B5, "\x0F\x84\x7F\x01\x00\x00", 6); // if ( this->m_nBurnTimer > 5000.0 )
938-
MemCpy((void*)0x6A7166, "\x0F\x84\x87\x00\x00\x00", 6); // if ( v6 <= 5000.0 )
939937
}
940938
else
941939
{
942940
MemSet((void*)0x6A74EA, 0x90, 5);
943941
MemSet((void*)0x737929, 0x90, 5);
942+
}
943+
944+
m_isVehicleBurnExplosionsEnabled = isEnabled;
945+
}
946+
947+
void CGameSA::SetVehicleBurnBlowUpEnabled(bool isEnabled)
948+
{
949+
if (isEnabled == m_isVehicleBurnBlowUpEnabled)
950+
return;
951+
952+
if (isEnabled)
953+
{
954+
MemCpy((void*)0x6A72B5, "\x0F\x84\x7F\x01\x00\x00", 6); // if ( this->m_nBurnTimer > 5000.0 )
955+
MemCpy((void*)0x6A7166, "\x0F\x84\x87\x00\x00\x00", 6); // if ( v6 <= 5000.0 )
956+
}
957+
else
958+
{
944959
MemSet((void*)0x6A72B5, 0x90, 6);
945960
MemSet((void*)0x6A7166, 0x90, 6);
946961
}
947962

948-
m_isVehicleBurnExplosionsEnabled = isEnabled;
963+
m_isVehicleBurnBlowUpEnabled = isEnabled;
949964
}
950965

951966
bool CGameSA::PerformChecks()

Client/game_sa/CGameSA.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ class CGameSA : public CGame
262262
bool IsVehicleBurnExplosionsEnabled() const noexcept override { return m_isVehicleBurnExplosionsEnabled; }
263263
void SetVehicleBurnExplosionsEnabled(bool isEnabled) override;
264264

265+
bool IsVehicleBurnBlowUpEnabled() const noexcept override { return m_isVehicleBurnBlowUpEnabled; }
266+
void SetVehicleBurnBlowUpEnabled(bool isEnabled) override;
267+
265268
unsigned long GetMinuteDuration();
266269
void SetMinuteDuration(unsigned long ulTime);
267270

@@ -396,6 +399,7 @@ class CGameSA : public CGame
396399
bool m_isExtendedWaterCannonsEnabled{false};
397400
bool m_isIgnoreFireStateEnabled{false};
398401
bool m_isVehicleBurnExplosionsEnabled{true};
402+
bool m_isVehicleBurnBlowUpEnabled{true};
399403

400404
static unsigned int& ClumpOffset;
401405

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6093,6 +6093,9 @@ bool CClientGame::SetWorldSpecialProperty(const WorldSpecialProperty property, c
60936093
case WorldSpecialProperty::VEHICLEBURNEXPLOSIONS:
60946094
g_pGame->SetVehicleBurnExplosionsEnabled(enabled);
60956095
break;
6096+
case WorldSpecialProperty::VEHICLEBURNBLOWUP:
6097+
g_pGame->SetVehicleBurnBlowUpEnabled(enabled);
6098+
break;
60966099
case WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART:
60976100
SetVehicleEngineAutoStartEnabled(enabled);
60986101
break;
@@ -6142,6 +6145,8 @@ bool CClientGame::IsWorldSpecialProperty(const WorldSpecialProperty property)
61426145
return m_pVehicleManager->IsSpawnFlyingComponentEnabled();
61436146
case WorldSpecialProperty::VEHICLEBURNEXPLOSIONS:
61446147
return g_pGame->IsVehicleBurnExplosionsEnabled();
6148+
case WorldSpecialProperty::VEHICLEBURNBLOWUP:
6149+
return g_pGame->IsVehicleBurnBlowUpEnabled();
61456150
case WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART:
61466151
return IsVehicleEngineAutoStartEnabled();
61476152
}
@@ -6944,6 +6949,7 @@ void CClientGame::ResetWorldProperties(const ResetWorldPropsInfo& resetPropsInfo
69446949
g_pGame->SetIgnoreFireStateEnabled(false);
69456950
m_pVehicleManager->SetSpawnFlyingComponentEnabled(true);
69466951
g_pGame->SetVehicleBurnExplosionsEnabled(true);
6952+
g_pGame->SetVehicleBurnBlowUpEnabled(true);
69476953
SetVehicleEngineAutoStartEnabled(true);
69486954
}
69496955

Client/mods/deathmatch/logic/CPacketHandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,6 +2419,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream)
24192419
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::IGNOREFIRESTATE, wsProps.data.ignoreFireState);
24202420
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::FLYINGCOMPONENTS, wsProps.data.flyingcomponents);
24212421
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::VEHICLEBURNEXPLOSIONS, wsProps.data.vehicleburnexplosions);
2422+
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::VEHICLEBURNBLOWUP, wsProps.data.vehicleburnblowup);
24222423
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART, wsProps.data.vehicleEngineAutoStart);
24232424

24242425
float fJetpackMaxHeight = 100;

Client/sdk/game/CGame.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ class __declspec(novtable) CGame
243243
virtual bool IsVehicleBurnExplosionsEnabled() const noexcept = 0;
244244
virtual void SetVehicleBurnExplosionsEnabled(bool isEnabled) = 0;
245245

246+
virtual bool IsVehicleBurnBlowUpEnabled() const noexcept = 0;
247+
virtual void SetVehicleBurnBlowUpEnabled(bool isEnabled) = 0;
248+
246249
virtual CWeapon* CreateWeapon() = 0;
247250
virtual CWeaponStat* CreateWeaponStat(eWeaponType weaponType, eWeaponSkill weaponSkill) = 0;
248251

Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti
265265
m_WorldSpecialProps[WorldSpecialProperty::IGNOREFIRESTATE] = false;
266266
m_WorldSpecialProps[WorldSpecialProperty::FLYINGCOMPONENTS] = true;
267267
m_WorldSpecialProps[WorldSpecialProperty::VEHICLEBURNEXPLOSIONS] = true;
268+
m_WorldSpecialProps[WorldSpecialProperty::VEHICLEBURNBLOWUP] = true;
268269
m_WorldSpecialProps[WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART] = true;
269270

270271
m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true;
@@ -4459,6 +4460,7 @@ void CGame::ResetWorldProperties(const ResetWorldPropsInfo& resetPropsInfo)
44594460
g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::IGNOREFIRESTATE, false);
44604461
g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::FLYINGCOMPONENTS, true);
44614462
g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLEBURNEXPLOSIONS, true);
4463+
g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLEBURNBLOWUP, true);
44624464
g_pGame->SetWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART, true);
44634465
}
44644466

Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const
191191
wsProps.data.ignoreFireState = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::IGNOREFIRESTATE);
192192
wsProps.data.flyingcomponents = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::FLYINGCOMPONENTS);
193193
wsProps.data.vehicleburnexplosions = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLEBURNEXPLOSIONS);
194+
wsProps.data.vehicleburnblowup = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLEBURNBLOWUP);
194195
wsProps.data.vehicleEngineAutoStart = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART);
195196
BitStream.Write(&wsProps);
196197

Shared/mods/deathmatch/logic/Enums.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ ADD_ENUM(WorldSpecialProperty::TUNNELWEATHERBLEND, "tunnelweatherblend")
119119
ADD_ENUM(WorldSpecialProperty::IGNOREFIRESTATE, "ignorefirestate")
120120
ADD_ENUM(WorldSpecialProperty::FLYINGCOMPONENTS, "flyingcomponents")
121121
ADD_ENUM(WorldSpecialProperty::VEHICLEBURNEXPLOSIONS, "vehicleburnexplosions")
122+
ADD_ENUM(WorldSpecialProperty::VEHICLEBURNBLOWUP, "vehicleburnblowup")
122123
ADD_ENUM(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART, "vehicle_engine_autostart")
123124
IMPLEMENT_ENUM_CLASS_END("world-special-property")
124125

Shared/mods/deathmatch/logic/Enums.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ enum class WorldSpecialProperty
9696
IGNOREFIRESTATE,
9797
FLYINGCOMPONENTS,
9898
VEHICLEBURNEXPLOSIONS,
99+
VEHICLEBURNBLOWUP,
99100
VEHICLE_ENGINE_AUTOSTART,
100101
};
101102
DECLARE_ENUM_CLASS(WorldSpecialProperty);

Shared/sdk/net/SyncStructures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure
20142014
bool ignoreFireState : 1;
20152015
bool flyingcomponents : 1;
20162016
bool vehicleburnexplosions : 1;
2017+
bool vehicleburnblowup : 1;
20172018
bool vehicleEngineAutoStart : 1;
20182019
} data;
20192020

@@ -2041,6 +2042,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure
20412042
data.ignoreFireState = false;
20422043
data.flyingcomponents = true;
20432044
data.vehicleburnexplosions = true;
2045+
data.vehicleburnblowup = true;
20442046
data.vehicleEngineAutoStart = true;
20452047
}
20462048
};

0 commit comments

Comments
 (0)