Skip to content

Commit 46f3580

Browse files
authored
Add new special world property ignorefirestate (#3845)
1 parent 6f90880 commit 46f3580

File tree

12 files changed

+69
-1
lines changed

12 files changed

+69
-1
lines changed

Client/game_sa/CGameSA.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,34 @@ void CGameSA::SetRoadSignsTextEnabled(bool isEnabled)
848848
m_isRoadSignsTextEnabled = isEnabled;
849849
}
850850

851+
void CGameSA::SetIgnoreFireStateEnabled(bool isEnabled)
852+
{
853+
if (isEnabled == m_isIgnoreFireStateEnabled)
854+
return;
855+
856+
if (isEnabled)
857+
{
858+
MemSet((void*)0x6511B9, 0x90, 10); // CCarEnterExit::IsVehicleStealable
859+
MemSet((void*)0x643A95, 0x90, 14); // CTaskComplexEnterCar::CreateFirstSubTask
860+
MemSet((void*)0x6900B5, 0x90, 14); // CTaskComplexCopInCar::ControlSubTask
861+
MemSet((void*)0x64F3DB, 0x90, 14); // CCarEnterExit::IsPlayerToQuitCarEnter
862+
863+
MemSet((void*)0x685A7F, 0x90, 14); // CTaskSimplePlayerOnFoot::ProcessPlayerWeapon
864+
}
865+
else
866+
{
867+
// Restore original bytes
868+
MemCpy((void*)0x6511B9, "\x88\x86\x90\x04\x00\x00\x85\xC0\x75\x3E", 10);
869+
MemCpy((void*)0x643A95, "\x8B\x88\x90\x04\x00\x00\x85\xC9\x0F\x85\x99\x01\x00\x00", 14);
870+
MemCpy((void*)0x6900B5, "\x8B\x81\x90\x04\x00\x00\x85\xC0\x0F\x85\x1A\x01\x00\x00", 14);
871+
MemCpy((void*)0x64F3DB, "\x8B\x85\x90\x04\x00\x00\x85\xC0\x0F\x85\x1B\x01\x00\x00", 14);
872+
873+
MemCpy((void*)0x685A7F, "\x8B\x86\x30\x07\x00\x00\x85\xC0\x0F\x85\x1D\x01\x00\x00", 14);
874+
}
875+
876+
m_isIgnoreFireStateEnabled = isEnabled;
877+
}
878+
851879
bool CGameSA::PerformChecks()
852880
{
853881
std::map<std::string, SCheatSA*>::iterator it;

Client/game_sa/CGameSA.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ class CGameSA : public CGame
249249
bool IsTunnelWeatherBlendEnabled() const noexcept override { return m_isTunnelWeatherBlendEnabled; }
250250
void SetTunnelWeatherBlendEnabled(bool isEnabled) override;
251251

252+
bool IsIgnoreFireStateEnabled() const noexcept override { return m_isIgnoreFireStateEnabled; }
253+
void SetIgnoreFireStateEnabled(bool isEnabled) override;
252254

253255
unsigned long GetMinuteDuration();
254256
void SetMinuteDuration(unsigned long ulTime);
@@ -378,6 +380,7 @@ class CGameSA : public CGame
378380
bool m_isRoadSignsTextEnabled{true};
379381
bool m_isBuildingsRemoved{false};
380382
bool m_isExtendedWaterCannonsEnabled{false};
383+
bool m_isIgnoreFireStateEnabled{false};
381384

382385
static unsigned int& ClumpOffset;
383386

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ CClientGame::CClientGame(bool bLocalPlay) : m_ServerInfo(new CServerInfo())
135135
m_Glitches[GLITCH_BADDRIVEBYHITBOX] = false;
136136
m_Glitches[GLITCH_QUICKSTAND] = false;
137137
m_Glitches[GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE] = false;
138+
138139
g_pMultiplayer->DisableBadDrivebyHitboxes(true);
139140

140141
// Remove Night & Thermal vision view (if enabled).
@@ -6025,6 +6026,9 @@ bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool is
60256026
case WorldSpecialProperty::TUNNELWEATHERBLEND:
60266027
g_pGame->SetTunnelWeatherBlendEnabled(isEnabled);
60276028
return true;
6029+
case WorldSpecialProperty::IGNOREFIRESTATE:
6030+
g_pGame->SetIgnoreFireStateEnabled(isEnabled);
6031+
return true;
60286032
}
60296033
return false;
60306034
}
@@ -6062,6 +6066,8 @@ bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property)
60626066
return g_pGame->IsRoadSignsTextEnabled();
60636067
case WorldSpecialProperty::TUNNELWEATHERBLEND:
60646068
return g_pGame->IsTunnelWeatherBlendEnabled();
6069+
case WorldSpecialProperty::IGNOREFIRESTATE:
6070+
return g_pGame->IsIgnoreFireStateEnabled();
60656071
}
60666072
return false;
60676073
}
@@ -6475,7 +6481,7 @@ void CClientGame::OutputServerInfo()
64756481
{
64766482
SString strEnabledGlitches;
64776483
const char* szGlitchNames[] = {"Quick reload", "Fast fire", "Fast move", "Crouch bug", "Close damage", "Hit anim", "Fast sprint",
6478-
"Bad driveby hitboxes", "Quick stand"};
6484+
"Bad driveby hitboxes", "Quick stand", "Kickout of vehicle on model replace"};
64796485
for (uint i = 0; i < NUM_GLITCHES; i++)
64806486
{
64816487
if (IsGlitchEnabled(i))

Client/mods/deathmatch/logic/CPacketHandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream)
23972397
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::ROADSIGNSTEXT, wsProps.data3.roadsignstext);
23982398
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::EXTENDEDWATERCANNONS, wsProps.data4.extendedwatercannons);
23992399
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::TUNNELWEATHERBLEND, wsProps.data5.tunnelweatherblend);
2400+
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::IGNOREFIRESTATE, wsProps.data6.ignoreFireState);
24002401

24012402
float fJetpackMaxHeight = 100;
24022403
if (!bitStream.Read(fJetpackMaxHeight))

Client/multiplayer_sa/CMultiplayerSA.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,7 @@ void CMultiplayerSA::DisableCloseRangeDamage(bool bDisabled)
18621862
MemPut<BYTE>(0x73BA00, 0x86);
18631863
}
18641864
}
1865+
18651866
bool CMultiplayerSA::GetInteriorSoundsEnabled()
18661867
{
18671868
return bInteriorSoundsEnabled;

Client/sdk/game/CGame.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ class __declspec(novtable) CGame
230230
virtual bool IsTunnelWeatherBlendEnabled() const noexcept = 0;
231231
virtual void SetTunnelWeatherBlendEnabled(bool isEnabled) = 0;
232232

233+
virtual bool IsIgnoreFireStateEnabled() const noexcept = 0;
234+
virtual void SetIgnoreFireStateEnabled(bool isEnabled) = 0;
235+
233236
virtual CWeapon* CreateWeapon() = 0;
234237
virtual CWeaponStat* CreateWeaponStat(eWeaponType weaponType, eWeaponSkill weaponSkill) = 0;
235238

Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti
258258
m_WorldSpecialProps[WorldSpecialProperty::EXTENDEDWATERCANNONS] = true;
259259
m_WorldSpecialProps[WorldSpecialProperty::ROADSIGNSTEXT] = true;
260260
m_WorldSpecialProps[WorldSpecialProperty::TUNNELWEATHERBLEND] = true;
261+
m_WorldSpecialProps[WorldSpecialProperty::IGNOREFIRESTATE] = false;
261262

262263
m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true;
263264
m_JetpackWeapons[WEAPONTYPE_TEC9] = true;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const
192192
wsProps.data3.roadsignstext = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::ROADSIGNSTEXT);
193193
wsProps.data4.extendedwatercannons = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::EXTENDEDWATERCANNONS);
194194
wsProps.data5.tunnelweatherblend = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::TUNNELWEATHERBLEND);
195+
wsProps.data6.ignoreFireState = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::IGNOREFIRESTATE);
195196
BitStream.Write(&wsProps);
196197
}
197198

Shared/mods/deathmatch/logic/Enums.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ ADD_ENUM(WorldSpecialProperty::FIREBALLDESTRUCT, "fireballdestruct")
101101
ADD_ENUM(WorldSpecialProperty::EXTENDEDWATERCANNONS, "extendedwatercannons")
102102
ADD_ENUM(WorldSpecialProperty::ROADSIGNSTEXT, "roadsignstext")
103103
ADD_ENUM(WorldSpecialProperty::TUNNELWEATHERBLEND, "tunnelweatherblend")
104+
ADD_ENUM(WorldSpecialProperty::IGNOREFIRESTATE, "ignorefirestate")
104105
IMPLEMENT_ENUM_CLASS_END("world-special-property")
105106

106107
IMPLEMENT_ENUM_BEGIN(ePacketID)

Shared/mods/deathmatch/logic/Enums.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ enum class WorldSpecialProperty
9191
ROADSIGNSTEXT,
9292
EXTENDEDWATERCANNONS,
9393
TUNNELWEATHERBLEND,
94+
IGNOREFIRESTATE,
9495
};
9596
DECLARE_ENUM_CLASS(WorldSpecialProperty);
9697

0 commit comments

Comments
 (0)