Skip to content

Commit e2fafa0

Browse files
committed
Move to special world property
1 parent b778390 commit e2fafa0

File tree

16 files changed

+65
-57
lines changed

16 files changed

+65
-57
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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ 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-
m_Glitches[GLITCH_IGNOREFIRESTATE] = false;
139-
g_pMultiplayer->SetIgnoreFireState(false);
140138

141139
g_pMultiplayer->DisableBadDrivebyHitboxes(true);
142140

@@ -5974,9 +5972,6 @@ bool CClientGame::SetGlitchEnabled(unsigned char ucGlitch, bool bEnabled)
59745972
g_pMultiplayer->DisableQuickReload(!bEnabled);
59755973
if (ucGlitch == GLITCH_CLOSEDAMAGE)
59765974
g_pMultiplayer->DisableCloseRangeDamage(!bEnabled);
5977-
if (ucGlitch == GLITCH_IGNOREFIRESTATE)
5978-
g_pMultiplayer->SetIgnoreFireState(bEnabled);
5979-
59805975
return true;
59815976
}
59825977
return false;
@@ -6031,6 +6026,9 @@ bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool is
60316026
case WorldSpecialProperty::TUNNELWEATHERBLEND:
60326027
g_pGame->SetTunnelWeatherBlendEnabled(isEnabled);
60336028
return true;
6029+
case WorldSpecialProperty::IGNOREFIRESTATE:
6030+
g_pGame->SetIgnoreFireStateEnabled(isEnabled);
6031+
return true;
60346032
}
60356033
return false;
60366034
}
@@ -6068,6 +6066,8 @@ bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property)
60686066
return g_pGame->IsRoadSignsTextEnabled();
60696067
case WorldSpecialProperty::TUNNELWEATHERBLEND:
60706068
return g_pGame->IsTunnelWeatherBlendEnabled();
6069+
case WorldSpecialProperty::IGNOREFIRESTATE:
6070+
return g_pGame->IsIgnoreFireStateEnabled();
60716071
}
60726072
return false;
60736073
}
@@ -6481,7 +6481,7 @@ void CClientGame::OutputServerInfo()
64816481
{
64826482
SString strEnabledGlitches;
64836483
const char* szGlitchNames[] = {"Quick reload", "Fast fire", "Fast move", "Crouch bug", "Close damage", "Hit anim", "Fast sprint",
6484-
"Bad driveby hitboxes", "Quick stand", "Kickout of vehicle on model replace", "Ignore fire state"};
6484+
"Bad driveby hitboxes", "Quick stand", "Kickout of vehicle on model replace"};
64856485
for (uint i = 0; i < NUM_GLITCHES; i++)
64866486
{
64876487
if (IsGlitchEnabled(i))

Client/mods/deathmatch/logic/CClientGame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ class CClientGame
200200
GLITCH_BADDRIVEBYHITBOX,
201201
GLITCH_QUICKSTAND,
202202
GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE,
203-
GLITCH_IGNOREFIRESTATE,
204203
NUM_GLITCHES
205204
};
206205

Client/mods/deathmatch/logic/CPacketHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2372,7 +2372,6 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream)
23722372
g_pClientGame->SetGlitchEnabled(CClientGame::GLITCH_FASTSPRINT, funBugs.data3.bFastSprint);
23732373
g_pClientGame->SetGlitchEnabled(CClientGame::GLITCH_BADDRIVEBYHITBOX, funBugs.data4.bBadDrivebyHitboxes);
23742374
g_pClientGame->SetGlitchEnabled(CClientGame::GLITCH_QUICKSTAND, funBugs.data5.bQuickStand);
2375-
g_pClientGame->SetGlitchEnabled(CClientGame::GLITCH_IGNOREFIRESTATE, funBugs.data6.bIgnoreFireState);
23762375

23772376
SWorldSpecialPropertiesStateSync wsProps;
23782377
if (bitStream.Can(eBitStreamVersion::WorldSpecialProperties))
@@ -2394,6 +2393,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream)
23942393
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::ROADSIGNSTEXT, wsProps.data3.roadsignstext);
23952394
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::EXTENDEDWATERCANNONS, wsProps.data4.extendedwatercannons);
23962395
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::TUNNELWEATHERBLEND, wsProps.data5.tunnelweatherblend);
2396+
g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::IGNOREFIRESTATE, wsProps.data6.ignoreFireState);
23972397

23982398
float fJetpackMaxHeight = 100;
23992399
if (!bitStream.Read(fJetpackMaxHeight))

Client/multiplayer_sa/CMultiplayerSA.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,30 +1862,6 @@ void CMultiplayerSA::DisableCloseRangeDamage(bool bDisabled)
18621862
}
18631863
}
18641864

1865-
void CMultiplayerSA::SetIgnoreFireState(bool ignore)
1866-
{
1867-
if (ignore)
1868-
{
1869-
MemSet((void*)0x6511B9, 0x90, 10); // CCarEnterExit::IsVehicleStealable
1870-
MemSet((void*)0x643A95, 0x90, 14); // CTaskComplexEnterCar::CreateFirstSubTask
1871-
MemSet((void*)0x6900B5, 0x90, 14); // CTaskComplexCopInCar::ControlSubTask
1872-
MemSet((void*)0x64F3DB, 0x90, 14); // CCarEnterExit::IsPlayerToQuitCarEnter
1873-
1874-
// CTaskSimplePlayerOnFoot::ProcessPlayerWeapon
1875-
MemSet((void*)0x685A7F, 0x90, 14);
1876-
}
1877-
else
1878-
{
1879-
// Restore original bytes
1880-
MemCpy((void*)0x6511B9, "\x88\x86\x90\x04\x00\x00\x85\xC0\x75\x3E", 10);
1881-
MemCpy((void*)0x643A95, "\x8B\x88\x90\x04\x00\x00\x85\xC9\x0F\x85\x99\x01\x00\x00", 14);
1882-
MemCpy((void*)0x6900B5, "\x8B\x81\x90\x04\x00\x00\x85\xC0\x0F\x85\x1A\x01\x00\x00", 14);
1883-
MemCpy((void*)0x64F3DB, "\x8B\x85\x90\x04\x00\x00\x85\xC0\x0F\x85\x1B\x01\x00\x00", 14);
1884-
1885-
MemCpy((void*)0x685A7F, "\x8B\x86\x30\x07\x00\x00\x85\xC0\x0F\x85\x1D\x01\x00\x00", 14);
1886-
}
1887-
}
1888-
18891865
bool CMultiplayerSA::GetInteriorSoundsEnabled()
18901866
{
18911867
return bInteriorSoundsEnabled;

Client/multiplayer_sa/CMultiplayerSA.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class CMultiplayerSA : public CMultiplayer
9999
void DisableQuickReload(bool bDisable);
100100
void DisableCloseRangeDamage(bool bDisable);
101101
void DisableBadDrivebyHitboxes(bool bDisable) { m_bBadDrivebyHitboxesDisabled = bDisable; }
102-
void SetIgnoreFireState(bool ignore) override;
103102

104103
bool GetExplosionsDisabled();
105104
void DisableExplosions(bool bDisabled);

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

Client/sdk/multiplayer/CMultiplayer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ class CMultiplayer
216216
virtual void DisableQuickReload(bool bDisable) = 0;
217217
virtual void DisableCloseRangeDamage(bool bDisable) = 0;
218218
virtual void DisableBadDrivebyHitboxes(bool bDisable) = 0;
219-
virtual void SetIgnoreFireState(bool ignore) = 0;
220219

221220
virtual bool GetExplosionsDisabled() = 0;
222221
virtual void DisableExplosions(bool bDisabled) = 0;

Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti
238238
m_Glitches[GLITCH_BADDRIVEBYHITBOX] = false;
239239
m_Glitches[GLITCH_QUICKSTAND] = false;
240240
m_Glitches[GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE] = false;
241-
m_Glitches[GLITCH_IGNOREFIRESTATE] = false;
242241
for (int i = 0; i < WEAPONTYPE_LAST_WEAPONTYPE; i++)
243242
m_JetpackWeapons[i] = false;
244243

@@ -259,6 +258,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti
259258
m_WorldSpecialProps[WorldSpecialProperty::EXTENDEDWATERCANNONS] = true;
260259
m_WorldSpecialProps[WorldSpecialProperty::ROADSIGNSTEXT] = true;
261260
m_WorldSpecialProps[WorldSpecialProperty::TUNNELWEATHERBLEND] = true;
261+
m_WorldSpecialProps[WorldSpecialProperty::IGNOREFIRESTATE] = false;
262262

263263
m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true;
264264
m_JetpackWeapons[WEAPONTYPE_TEC9] = true;
@@ -274,7 +274,6 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti
274274
m_GlitchNames["baddrivebyhitbox"] = GLITCH_BADDRIVEBYHITBOX;
275275
m_GlitchNames["quickstand"] = GLITCH_QUICKSTAND;
276276
m_GlitchNames["kickoutofvehicle_onmodelreplace"] = GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE;
277-
m_GlitchNames["ignorefirestate"] = GLITCH_IGNOREFIRESTATE;
278277

279278
m_bCloudsEnabled = true;
280279

0 commit comments

Comments
 (0)