Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ CClientGame::CClientGame(bool bLocalPlay) : m_ServerInfo(new CServerInfo())
m_Glitches[GLITCH_BADDRIVEBYHITBOX] = false;
m_Glitches[GLITCH_QUICKSTAND] = false;
m_Glitches[GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE] = false;
m_Glitches[GLITCH_IGNOREFIRESTATE] = false;
g_pMultiplayer->SetIgnoreFireState(false);

g_pMultiplayer->DisableBadDrivebyHitboxes(true);

// Remove Night & Thermal vision view (if enabled).
Expand Down Expand Up @@ -5971,6 +5974,9 @@ bool CClientGame::SetGlitchEnabled(unsigned char ucGlitch, bool bEnabled)
g_pMultiplayer->DisableQuickReload(!bEnabled);
if (ucGlitch == GLITCH_CLOSEDAMAGE)
g_pMultiplayer->DisableCloseRangeDamage(!bEnabled);
if (ucGlitch == GLITCH_IGNOREFIRESTATE)
g_pMultiplayer->SetIgnoreFireState(bEnabled);

return true;
}
return false;
Expand Down Expand Up @@ -6475,7 +6481,7 @@ void CClientGame::OutputServerInfo()
{
SString strEnabledGlitches;
const char* szGlitchNames[] = {"Quick reload", "Fast fire", "Fast move", "Crouch bug", "Close damage", "Hit anim", "Fast sprint",
"Bad driveby hitboxes", "Quick stand"};
"Bad driveby hitboxes", "Quick stand", "Kickout of vehicle on model replace", "Ignore fire state"};
for (uint i = 0; i < NUM_GLITCHES; i++)
{
if (IsGlitchEnabled(i))
Expand Down
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/CClientGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class CClientGame
GLITCH_BADDRIVEBYHITBOX,
GLITCH_QUICKSTAND,
GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE,
GLITCH_IGNOREFIRESTATE,
NUM_GLITCHES
};

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 @@ -2372,6 +2372,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream)
g_pClientGame->SetGlitchEnabled(CClientGame::GLITCH_FASTSPRINT, funBugs.data3.bFastSprint);
g_pClientGame->SetGlitchEnabled(CClientGame::GLITCH_BADDRIVEBYHITBOX, funBugs.data4.bBadDrivebyHitboxes);
g_pClientGame->SetGlitchEnabled(CClientGame::GLITCH_QUICKSTAND, funBugs.data5.bQuickStand);
g_pClientGame->SetGlitchEnabled(CClientGame::GLITCH_IGNOREFIRESTATE, funBugs.data6.bIgnoreFireState);

SWorldSpecialPropertiesStateSync wsProps;
if (bitStream.Can(eBitStreamVersion::WorldSpecialProperties))
Expand Down
25 changes: 25 additions & 0 deletions Client/multiplayer_sa/CMultiplayerSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1861,6 +1861,31 @@ void CMultiplayerSA::DisableCloseRangeDamage(bool bDisabled)
MemPut<BYTE>(0x73BA00, 0x86);
}
}

void CMultiplayerSA::SetIgnoreFireState(bool ignore)
{
if (ignore)
{
MemSet((void*)0x6511B9, 0x90, 10); // CCarEnterExit::IsVehicleStealable
MemSet((void*)0x643A95, 0x90, 14); // CTaskComplexEnterCar::CreateFirstSubTask
MemSet((void*)0x6900B5, 0x90, 14); // CTaskComplexCopInCar::ControlSubTask
MemSet((void*)0x64F3DB, 0x90, 14); // CCarEnterExit::IsPlayerToQuitCarEnter

// CTaskSimplePlayerOnFoot::ProcessPlayerWeapon
MemSet((void*)0x685A7F, 0x90, 14);
}
else
{
// Restore original bytes
MemCpy((void*)0x6511B9, "\x88\x86\x90\x04\x00\x00\x85\xC0\x75\x3E", 10);
MemCpy((void*)0x643A95, "\x8B\x88\x90\x04\x00\x00\x85\xC9\x0F\x85\x99\x01\x00\x00", 14);
MemCpy((void*)0x6900B5, "\x8B\x81\x90\x04\x00\x00\x85\xC0\x0F\x85\x1A\x01\x00\x00", 14);
MemCpy((void*)0x64F3DB, "\x8B\x85\x90\x04\x00\x00\x85\xC0\x0F\x85\x1B\x01\x00\x00", 14);

MemCpy((void*)0x685A7F, "\x8B\x86\x30\x07\x00\x00\x85\xC0\x0F\x85\x1D\x01\x00\x00", 14);
}
}

bool CMultiplayerSA::GetInteriorSoundsEnabled()
{
return bInteriorSoundsEnabled;
Expand Down
1 change: 1 addition & 0 deletions Client/multiplayer_sa/CMultiplayerSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class CMultiplayerSA : public CMultiplayer
void DisableQuickReload(bool bDisable);
void DisableCloseRangeDamage(bool bDisable);
void DisableBadDrivebyHitboxes(bool bDisable) { m_bBadDrivebyHitboxesDisabled = bDisable; }
void SetIgnoreFireState(bool ignore) override;

bool GetExplosionsDisabled();
void DisableExplosions(bool bDisabled);
Expand Down
1 change: 1 addition & 0 deletions Client/sdk/multiplayer/CMultiplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class CMultiplayer
virtual void DisableQuickReload(bool bDisable) = 0;
virtual void DisableCloseRangeDamage(bool bDisable) = 0;
virtual void DisableBadDrivebyHitboxes(bool bDisable) = 0;
virtual void SetIgnoreFireState(bool ignore) = 0;

virtual bool GetExplosionsDisabled() = 0;
virtual void DisableExplosions(bool bDisabled) = 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 @@ -238,6 +238,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti
m_Glitches[GLITCH_BADDRIVEBYHITBOX] = false;
m_Glitches[GLITCH_QUICKSTAND] = false;
m_Glitches[GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE] = false;
m_Glitches[GLITCH_IGNOREFIRESTATE] = false;
for (int i = 0; i < WEAPONTYPE_LAST_WEAPONTYPE; i++)
m_JetpackWeapons[i] = false;

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

m_bCloudsEnabled = true;

Expand Down
1 change: 1 addition & 0 deletions Server/mods/deathmatch/logic/CGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class CGame
GLITCH_BADDRIVEBYHITBOX,
GLITCH_QUICKSTAND,
GLITCH_KICKOUTOFVEHICLE_ONMODELREPLACE,
GLITCH_IGNOREFIRESTATE,
NUM_GLITCHES
};

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 @@ -170,6 +170,7 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const
funBugs.data3.bFastSprint = g_pGame->IsGlitchEnabled(CGame::GLITCH_FASTSPRINT);
funBugs.data4.bBadDrivebyHitboxes = g_pGame->IsGlitchEnabled(CGame::GLITCH_BADDRIVEBYHITBOX);
funBugs.data5.bQuickStand = g_pGame->IsGlitchEnabled(CGame::GLITCH_QUICKSTAND);
funBugs.data6.bIgnoreFireState = g_pGame->IsGlitchEnabled(CGame::GLITCH_IGNOREFIRESTATE);
BitStream.Write(&funBugs);

// Write world special properties states
Expand Down
17 changes: 17 additions & 0 deletions Shared/sdk/net/SyncStructures.h
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,10 @@ struct SFunBugsStateSync : public ISyncStructure
{
BITCOUNT5 = 1
};
enum
{
BITCOUNT6 = 1
};

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

if (bitStream.Can(eBitStreamVersion::Glitch_IgnoreFireState))
bOk &= bitStream.ReadBits(reinterpret_cast<char*>(&data6), BITCOUNT6);
else
data6.bIgnoreFireState = 0;

//// Example for adding item:
// if ( bitStream.Version() >= 0x999 )
// bOk &= bitStream.ReadBits ( reinterpret_cast < char* > ( &data9 ), BITCOUNT9 );
Expand All @@ -1977,6 +1986,8 @@ struct SFunBugsStateSync : public ISyncStructure
bitStream.WriteBits(reinterpret_cast<const char*>(&data4), BITCOUNT4);
if (bitStream.Can(eBitStreamVersion::QuickStandGlitch))
bitStream.WriteBits(reinterpret_cast<const char*>(&data5), BITCOUNT5);
if (bitStream.Can(eBitStreamVersion::Glitch_IgnoreFireState))
bitStream.WriteBits(reinterpret_cast<const char*>(&data6), BITCOUNT6);

//// Example for adding item:
// if (bitStream.Can(eBitStreamVersion::YourGlitch))
Expand Down Expand Up @@ -2015,6 +2026,12 @@ struct SFunBugsStateSync : public ISyncStructure
{
bool bQuickStand : 1;
} data5;

// Add new ones in separate structs
struct
{
bool bIgnoreFireState : 1;
} data6;
};

//////////////////////////////////////////
Expand Down
4 changes: 4 additions & 0 deletions Shared/sdk/net/bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,10 @@ enum class eBitStreamVersion : unsigned short
// 2024-09-04
RespawnObject_Serverside,

// Add ignorefirestate glitch
// 2024-11-07
Glitch_IgnoreFireState,

// This allows us to automatically increment the BitStreamVersion when things are added to this enum.
// Make sure you only add things above this comment.
Next,
Expand Down
Loading