ставь чайник, зажигай плиту
-
Автор темы
- #1
C++:
void __fastcall Hooked_RunCommand(void* ecx, void* edx, IBasePlayer* player, CUserCmd* ucmd, IMoveHelper* moveHelper)
{
static auto RunCommand = g_pPredictHook->GetOriginal< RunCommandFn >(19);
if (csgo->DoUnload || player == nullptr || csgo->local == nullptr || !csgo->local->isAlive())
return RunCommand(ecx, player, ucmd, moveHelper);
if (interfaces.engine->IsConnected() && interfaces.engine->IsInGame()) {
if (player == csgo->local) {
if (int(1.f / interfaces.global_vars->interval_per_tick) + csgo->unpdred_tick + 6 <= ucmd->tick_count)
{
ucmd->hasbeenpredicted = true;
return;
}
float m_flVelModBackup = csgo->local->GetVelocityModifier();
int m_nTickbase = csgo->local->GetTickBase();
int m_flCurtime = interfaces.global_vars->curtime;
if (ucmd->command_number == CMAntiAim::Get().cmd_tick) {
csgo->local->GetTickBasePtr() = CMAntiAim::Get().base_tick - csgo->m_nTickbaseShift + 1;
++csgo->local->GetTickBasePtr();
interfaces.global_vars->curtime = TICKS_TO_TIME(csgo->local->GetTickBasePtr());
}
if (csgo->ShouldUpdate && ucmd->command_number == csgo->client_state->nLastCommandAck + 1)
csgo->local->GetVelocityModifier() = csgo->g_flVelMod;
RunCommand(ecx, player, ucmd, moveHelper);
if (!csgo->ShouldUpdate)
csgo->local->GetVelocityModifier() = m_flVelModBackup;
if (ucmd->command_number == CMAntiAim::Get().cmd_tick)
{
csgo->local->GetTickBasePtr() = m_nTickbase;
interfaces.global_vars->curtime = m_flCurtime;
}
}
}
else
RunCommand(ecx, player, ucmd, moveHelper);
}