-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
void BunnyHop::edgeBug(CUserCmd* cmd)
{
if (!g_LocalPlayer !g_LocalPlayer->IsAlive())
return;
if (g_LocalPlayer->m_fFlags() & 1)
return;
if (GetKeyState(g_Options.edge_bug_key))
{
g_CVar->FindVar("sv_min_jump_landing_sound")->SetValue("63464578");
}
else
{
g_CVar->FindVar("sv_min_jump_landing_sound")->SetValue("260");
}
if (!g_Options.edge_bug !GetAsyncKeyState(g_Options.edge_bug_key)) {
shouldEdgebug = false;
return;
}
static Vector2D movebackup;
static int buttonsbackup;
bool predicted_successful = false;
static ConVar* sv_gravity = g_CVar->FindVar("sv_gravity");
float edgebugZVel = (sv_gravity->GetFloat() * 0.5f * g_GlobalVars->interval_per_tick);
should_duck = 0;
for (auto t = 0; t < 2; ++t) {
if (t == 1) {
should_duck = 1;
}
for (int i = 0; i < g_Options.ebtick; i++) {
edgebugpos = g_LocalPlayer->m_vecOrigin();
if (shouldEdgebug) {
cmd->sidemove = 0;
cmd->forwardmove = 0;
}
else {
movebackup.x = cmd->sidemove;
movebackup.y = cmd->forwardmove;
buttonsbackup = cmd->buttons;
}
prediction->StartPrediction(cmd);
shouldEdgebug = prediction->getVelocity().z < -edgebugZVel && floor(abs(g_LocalPlayer->m_vecVelocity().z)) == floor(abs(edgebugZVel)) && g_LocalPlayer->m_nMoveType() != MOVETYPE_LADDER;
prediction->EndPrediction();
if (const auto mt = g_LocalPlayer->m_nMoveType(); mt == MOVETYPE_LADDER)
break;
if (shouldEdgebug) {
if (should_duck)
cmd->buttons |= IN_DUCK;
return;
}
}
should_duck = 0;
}
}