diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 995dd528..9daab34a 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -134,24 +134,27 @@ void CreateMove() { } else { flag = false; } -} -void GetUserCmd(CUserCmd* cmd, int sequence_number) { - if (!cmd) return; - if (!cmd->command_number) return; + // Previously was in GetUserCmd + // Thanks Blackfire for helping me improve removecond! + + if (!g_pUserCmd) return; + if (!g_pUserCmd->command_number) return; if (!lagMasterSwitch) return; int amount = int(lagValue); if (!ExploitActive()) { amount = int(mini_lag_exploit); } if (!amount) return; - cmd->command_number += amount; - *(int*)((unsigned)g_IBaseClientState + offsets::lastoutgoingcommand()) += amount; - //*(INetChannel**)((unsigned)g_IBaseClientState + offsets::m_NetChannel()); + // Modifying command_number and lastoutgoingcommand turned out to be useless + + //cmd->command_number += amount; + //*(int*)((unsigned)g_IBaseClientState + offsets::lastoutgoingcommand()) += amount; + INetChannel* ch = (INetChannel*)g_IEngine->GetNetChannelInfo(); int& m_nOutSequenceNr = *(int*)((unsigned)ch + offsets::m_nOutSequenceNr()); m_nOutSequenceNr += amount; } -}}} \ No newline at end of file +}}} diff --git a/src/hacks/LagExploit.hpp b/src/hacks/LagExploit.hpp index c3297a2f..2aef6837 100644 --- a/src/hacks/LagExploit.hpp +++ b/src/hacks/LagExploit.hpp @@ -17,7 +17,6 @@ namespace hacks { namespace shared { namespace lagexploit { void CreateMove(); void AddExploitTicks(int ticks); bool ExploitActive(); -void GetUserCmd(CUserCmd*, int); }}} diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index 34c9a7c4..40297113 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -92,7 +92,6 @@ CUserCmd* GetUserCmd_hook(IInput* _this, int sequence_number) { ch = (INetChannel*)g_IEngine->GetNetChannelInfo();//*(INetChannel**)((unsigned)g_IBaseClientState + offsets::m_NetChannel()); *(int*)((unsigned)ch + offsets::m_nOutSequenceNr()) = def->command_number - 1; } - hacks::shared::lagexploit::GetUserCmd(def, sequence_number); return def; }