-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
void copy_command(CUserCmd* cmd, int tickbase_shift)
{
static auto cl_forwardspeed = interfaces.cvars->FindVar("cl_forwardspeed");
static auto cl_sidespeed = interfaces.cvars->FindVar("cl_sidespeed");
if (vars.ragebot.teleport_off)
{
cmd->forwardmove = 0.0f;
cmd->sidemove = 0.0f;
}
else
{
if (csgo->original_forwardmove >= 5.0f)
cmd->forwardmove = cl_forwardspeed->GetFloat();
else if (csgo->original_forwardmove <= -5.0f)
cmd->forwardmove = -cl_forwardspeed->GetFloat();
if (csgo->original_sidemove >= 5.0f)
cmd->sidemove = cl_sidespeed->GetFloat();
else if (csgo->original_sidemove <= -5.0f)
cmd->sidemove = -cl_sidespeed->GetFloat();
}
auto commands_to_add = 0;
do
{
auto sequence_number = commands_to_add + cmd->command_number;
auto command = interfaces.input->GetUserCmd(sequence_number);
auto verified_command = interfaces.input->GetVerifiedCmd(sequence_number);
memcpy(command, cmd, sizeof(CUserCmd)); //-V598
if (command->tick_count != INT_MAX && csgo->client_state->iDeltaTick > 0)
interfaces.prediction->Update(csgo->client_state->iDeltaTick, true, csgo->client_state->nLastCommandAck, csgo->client_state->nLastOutgoingCommand + csgo->client_state->iChokedCommands);
command->command_number = sequence_number;
command->hasbeenpredicted = command->tick_count != INT_MAX;
++csgo->client_state->iChokedCommands; //-V807
if (csgo->client_state->pNetChannel)
{
++csgo->client_state->pNetChannel->iChokedPackets;
++csgo->client_state->pNetChannel->iOutSequenceNr;
}
Math::normalize_angles(command->viewangles);
memcpy(&verified_command->m_cmd, command, sizeof(CUserCmd)); //-V598
verified_command->m_crc = command->GetChecksum();
++commands_to_add;
} while (commands_to_add != tickbase_shift);
*(bool*)((uintptr_t)interfaces.prediction + 0x24) = true;
*(int*)((uintptr_t)interfaces.prediction + 0x1C) = 0;
}