Merge pull request #130 from julianacat/master

Added more control over lagexploit
This commit is contained in:
julianacat 2017-05-23 13:06:40 -05:00 committed by GitHub
commit e575f2bb87
2 changed files with 9 additions and 4 deletions

View File

@ -581,6 +581,8 @@ static const std::string list_tf2 = R"(
"Miscellaneous" [
"Miscellaneous Settings"
"removecond_master"
"removecond_value"
"removecond_key"
"removecond_fire"
"removecond_taunt"

View File

@ -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;
}
}}}