Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Client/game_sa/CGameSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, SCheatSA*>::iterator it;
Expand Down
4 changes: 4 additions & 0 deletions Client/game_sa/CGameSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/CPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions Client/sdk/game/CGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions Server/mods/deathmatch/logic/CGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions Shared/mods/deathmatch/logic/Enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
1 change: 1 addition & 0 deletions Shared/mods/deathmatch/logic/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ enum class WorldSpecialProperty
IGNOREFIRESTATE,
FLYINGCOMPONENTS,
VEHICLEBURNEXPLOSIONS,
VEHICLEBURNBLOWUP,
VEHICLE_ENGINE_AUTOSTART,
};
DECLARE_ENUM_CLASS(WorldSpecialProperty);
Expand Down
2 changes: 2 additions & 0 deletions Shared/sdk/net/SyncStructures.h
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure
bool ignoreFireState : 1;
bool flyingcomponents : 1;
bool vehicleburnexplosions : 1;
bool vehicleburnblowup : 1;
bool vehicleEngineAutoStart : 1;
} data;

Expand Down Expand Up @@ -2041,6 +2042,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure
data.ignoreFireState = false;
data.flyingcomponents = true;
data.vehicleburnexplosions = true;
data.vehicleburnblowup = true;
data.vehicleEngineAutoStart = true;
}
};
Expand Down