-
Автор темы
- #1
C++:
void aim::AutoStop(CUserCmd* cmd)
{
Vector real_view;
m_engine()->GetViewAngles(real_view);
Vector vMove(abs(cmd->m_forwardmove), abs(cmd->m_sidemove), abs(cmd->m_upmove));
float flSpeed = sqrt(vMove.x * vMove.x + vMove.y * vMove.y), flYaw;
Vector vMove2;
math::VectorAngles(vMove, vMove2);
vMove2.Normalize();
flYaw = DEG2RAD(cmd->m_viewangles.y - g_ctx.globals.original.y + vMove2.y);
cmd->m_forwardmove = cos(flYaw) * flSpeed;
cmd->m_sidemove = sin(flYaw) * flSpeed;
QAngle angResistance = QAngle(0, 0, 0);
VectorAngles((g_ctx.local()->m_vecVelocity() * -1.f), angResistance);
angResistance.yaw = real_view.y - angResistance.yaw;
angResistance.pitch = real_view.x - angResistance.pitch;
Vector vecResistance = Vector(0, 0, 0);
AngleVectors(angResistance, vecResistance);
cmd->m_forwardmove = std::clamp(vecResistance.x, -450.f, 450.f);
cmd->m_sidemove = std::clamp(vecResistance.y, -450.f, 450.f);
}
bool aim::automatic_stop(CUserCmd* cmd)
{
if (!should_stop)
return true;
if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop)
return true;
if (g_ctx.globals.slowwalking)
return true;
if (!(g_ctx.local()->m_fFlags() & FL_ONGROUND && engineprediction::get().backup_data.flags & FL_ONGROUND)) //-V807
return true;
if (g_ctx.globals.weapon->is_empty())
return true;
if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_BETWEEN_SHOTS] && !g_ctx.globals.weapon->can_fire(false))
return true;
auto animlayer = g_ctx.local()->get_animlayers()[1];
if (animlayer.m_nSequence)
{
auto activity = g_ctx.local()->sequence_activity(animlayer.m_nSequence);
if (activity == ACT_CSGO_RELOAD && animlayer.m_flWeight > 0.0f)
return true;
}
auto weapon_info = g_ctx.globals.weapon->get_csweapon_info();
if (!weapon_info)
return true;
auto max_speed = 0.34f * (g_ctx.globals.scoped ? weapon_info->flMaxPlayerSpeedAlt : weapon_info->flMaxPlayerSpeed);
if (engineprediction::get().backup_data.velocity.Length2D() < max_speed)
slowwalk::get().create_move(cmd);
else
{
AutoStop(cmd);//суппупирир хуетень, еоторая работает
if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_FORCE_ACCURACY]) {
should_stop = true;
return false;
}
}
should_stop = false;
return true;
}
Последнее редактирование: