From b0635ae9436f6038acd76347f63ea02fe62792df Mon Sep 17 00:00:00 2001 From: Julian Rowe Date: Tue, 23 May 2017 13:02:28 -0500 Subject: [PATCH] Added more control over lagexploit --- src/gui/ncc/Menu.cpp | 2 ++ src/hacks/LagExploit.cpp | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/ncc/Menu.cpp b/src/gui/ncc/Menu.cpp index 6a050ecb..314a1d7d 100644 --- a/src/gui/ncc/Menu.cpp +++ b/src/gui/ncc/Menu.cpp @@ -581,6 +581,8 @@ static const std::string list_tf2 = R"( "Miscellaneous" [ "Miscellaneous Settings" + "removecond_master" + "removecond_value" "removecond_key" "removecond_fire" "removecond_taunt" diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 3d558ec9..44dfe963 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -11,7 +11,9 @@ namespace hacks { namespace shared { namespace lagexploit { CatVar toggle(CV_SWITCH, "removecond_toggle", "0", "Toggle Lag Exploit", "Toggle lag exploit (RemoveCond)"); CatVar key(CV_KEY, "removecond_key", "0", "RemoveCond Key"); - +CatVar lagMasterSwitch(CV_SWITCH, "removecond_master", "1", "Master Lag Exploit Switch", "Master switch for the lag exploit\nDisabling this disables everything else that uses remove conds"); +CatVar lagValue(CV_INT, "removecond_value", "450", "RemoveCond Value", "Value of user cmds to spam with"); + CatCommand do_lagexploit("removecond", "RemoveCond (for use in scripts)", []() { AddExploitTicks(6); }); @@ -95,14 +97,15 @@ void CreateMove() { void GetUserCmd(CUserCmd* cmd, int sequence_number) { if (!ExploitActive()) return; + if (!lagMasterSwitch) return; if (!cmd) return; if (!cmd->command_number) return; - cmd->command_number += 450; - *(int*)((unsigned)g_IBaseClientState + offsets::lastoutgoingcommand()) += 450; + cmd->command_number += (int)lagValue; + *(int*)((unsigned)g_IBaseClientState + offsets::lastoutgoingcommand()) += (int)lagValue; //*(INetChannel**)((unsigned)g_IBaseClientState + offsets::m_NetChannel()); INetChannel* ch = (INetChannel*)g_IEngine->GetNetChannelInfo(); int& m_nOutSequenceNr = *(int*)((unsigned)ch + offsets::m_nOutSequenceNr()); - m_nOutSequenceNr += 450; + m_nOutSequenceNr += (int)lagValue; } }}}