Skip to content

Commit b778390

Browse files
committed
Add new glitch
1 parent ad1da87 commit b778390

File tree

11 files changed

+61
-1
lines changed

11 files changed

+61
-1
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ 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);
140+
138141
g_pMultiplayer->DisableBadDrivebyHitboxes(true);
139142

140143
// Remove Night & Thermal vision view (if enabled).
@@ -5971,6 +5974,9 @@ bool CClientGame::SetGlitchEnabled(unsigned char ucGlitch, bool bEnabled)
59715974
g_pMultiplayer->DisableQuickReload(!bEnabled);
59725975
if (ucGlitch == GLITCH_CLOSEDAMAGE)
59735976
g_pMultiplayer->DisableCloseRangeDamage(!bEnabled);
5977+
if (ucGlitch == GLITCH_IGNOREFIRESTATE)
5978+
g_pMultiplayer->SetIgnoreFireState(bEnabled);
5979+
59745980
return true;
59755981
}
59765982
return false;
@@ -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", "Ignore fire state"};
64796485
for (uint i = 0; i < NUM_GLITCHES; i++)
64806486
{
64816487
if (IsGlitchEnabled(i))

Client/mods/deathmatch/logic/CClientGame.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class CClientGame
200200
GLITCH_BADDRIVEBYHITBOX,
201201
GLITCH_QUICKSTAND,
202202
GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE,
203+
GLITCH_IGNOREFIRESTATE,
203204
NUM_GLITCHES
204205
};
205206

Client/mods/deathmatch/logic/CPacketHandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,6 +2372,7 @@ 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);
23752376

23762377
SWorldSpecialPropertiesStateSync wsProps;
23772378
if (bitStream.Can(eBitStreamVersion::WorldSpecialProperties))

Client/multiplayer_sa/CMultiplayerSA.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,31 @@ void CMultiplayerSA::DisableCloseRangeDamage(bool bDisabled)
18611861
MemPut<BYTE>(0x73BA00, 0x86);
18621862
}
18631863
}
1864+
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+
18641889
bool CMultiplayerSA::GetInteriorSoundsEnabled()
18651890
{
18661891
return bInteriorSoundsEnabled;

Client/multiplayer_sa/CMultiplayerSA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ 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;
102103

103104
bool GetExplosionsDisabled();
104105
void DisableExplosions(bool bDisabled);

Client/sdk/multiplayer/CMultiplayer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ 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;
219220

220221
virtual bool GetExplosionsDisabled() = 0;
221222
virtual void DisableExplosions(bool bDisabled) = 0;

Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ 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;
241242
for (int i = 0; i < WEAPONTYPE_LAST_WEAPONTYPE; i++)
242243
m_JetpackWeapons[i] = false;
243244

@@ -273,6 +274,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti
273274
m_GlitchNames["baddrivebyhitbox"] = GLITCH_BADDRIVEBYHITBOX;
274275
m_GlitchNames["quickstand"] = GLITCH_QUICKSTAND;
275276
m_GlitchNames["kickoutofvehicle_onmodelreplace"] = GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE;
277+
m_GlitchNames["ignorefirestate"] = GLITCH_IGNOREFIRESTATE;
276278

277279
m_bCloudsEnabled = true;
278280

Server/mods/deathmatch/logic/CGame.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ class CGame
194194
GLITCH_BADDRIVEBYHITBOX,
195195
GLITCH_QUICKSTAND,
196196
GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE,
197+
GLITCH_IGNOREFIRESTATE,
197198
NUM_GLITCHES
198199
};
199200

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const
170170
funBugs.data3.bFastSprint = g_pGame->IsGlitchEnabled(CGame::GLITCH_FASTSPRINT);
171171
funBugs.data4.bBadDrivebyHitboxes = g_pGame->IsGlitchEnabled(CGame::GLITCH_BADDRIVEBYHITBOX);
172172
funBugs.data5.bQuickStand = g_pGame->IsGlitchEnabled(CGame::GLITCH_QUICKSTAND);
173+
funBugs.data6.bIgnoreFireState = g_pGame->IsGlitchEnabled(CGame::GLITCH_IGNOREFIRESTATE);
173174
BitStream.Write(&funBugs);
174175

175176
// Write world special properties states

Shared/sdk/net/SyncStructures.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,10 @@ struct SFunBugsStateSync : public ISyncStructure
19371937
{
19381938
BITCOUNT5 = 1
19391939
};
1940+
enum
1941+
{
1942+
BITCOUNT6 = 1
1943+
};
19401944

19411945
bool Read(NetBitStreamInterface& bitStream)
19421946
{
@@ -1958,6 +1962,11 @@ struct SFunBugsStateSync : public ISyncStructure
19581962
else
19591963
data5.bQuickStand = 0;
19601964

1965+
if (bitStream.Can(eBitStreamVersion::Glitch_IgnoreFireState))
1966+
bOk &= bitStream.ReadBits(reinterpret_cast<char*>(&data6), BITCOUNT6);
1967+
else
1968+
data6.bIgnoreFireState = 0;
1969+
19611970
//// Example for adding item:
19621971
// if ( bitStream.Version() >= 0x999 )
19631972
// bOk &= bitStream.ReadBits ( reinterpret_cast < char* > ( &data9 ), BITCOUNT9 );
@@ -1977,6 +1986,8 @@ struct SFunBugsStateSync : public ISyncStructure
19771986
bitStream.WriteBits(reinterpret_cast<const char*>(&data4), BITCOUNT4);
19781987
if (bitStream.Can(eBitStreamVersion::QuickStandGlitch))
19791988
bitStream.WriteBits(reinterpret_cast<const char*>(&data5), BITCOUNT5);
1989+
if (bitStream.Can(eBitStreamVersion::Glitch_IgnoreFireState))
1990+
bitStream.WriteBits(reinterpret_cast<const char*>(&data6), BITCOUNT6);
19801991

19811992
//// Example for adding item:
19821993
// if (bitStream.Can(eBitStreamVersion::YourGlitch))
@@ -2015,6 +2026,12 @@ struct SFunBugsStateSync : public ISyncStructure
20152026
{
20162027
bool bQuickStand : 1;
20172028
} data5;
2029+
2030+
// Add new ones in separate structs
2031+
struct
2032+
{
2033+
bool bIgnoreFireState : 1;
2034+
} data6;
20182035
};
20192036

20202037
//////////////////////////////////////////

0 commit comments

Comments
 (0)