void FakeWalk(CUserCmd* cmd)
{
if (!Vars.Misc.FakeWalk)
return;
if (!G::PressedKeys[Vars.Misc.FakeWalkKey])
return;
CBaseEntity* localplayer = (CBaseEntity*)I::ClientEntList->GetClientEntity(I::Engine->GetLocalPlayer());
if (!localplayer)
return;
static int iChoked = -1;
iChoked++;
if (iChoked < 1)
{
G::SendPacket = false;
cmd->tick_count += 10;
cmd->command_number += 7 + cmd->tick_count % 2 ? 0 : 1;
cmd->buttons |= localplayer->GetMoveType() == IN_BACK;
cmd->forwardmove = cmd->sidemove = 0.f;
}
else
{
G::SendPacket = true;
iChoked = -1;
I::Globals->frametime *= (localplayer->GetVelocity().Length2D()) / 1.f;
cmd->buttons |= localplayer->GetMoveType() == IN_FORWARD;
}
}