Improved RemoveCond

This commit is contained in:
nullifiedcat 2017-07-06 14:34:11 +03:00
parent 4610b19b86
commit 60681b08bb
3 changed files with 11 additions and 10 deletions

View File

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

View File

@ -17,7 +17,6 @@ namespace hacks { namespace shared { namespace lagexploit {
void CreateMove();
void AddExploitTicks(int ticks);
bool ExploitActive();
void GetUserCmd(CUserCmd*, int);
}}}

View File

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