-
Автор темы
- #1
/|\:
void Resolver::ResolveStand( AimPlayer* data, LagRecord* record ) {
// for no-spread call a seperate resolver.
if( !g_hooks.b[ XOR( "antiUntrusted" ) ] ) {
StandNS( data, record );
return;
}
// get predicted away angle for the player.
float away = GetAwayAngle( record );
// pointer for easy access.
LagRecord* move = &data->m_walk_record;
// we have a valid moving record.
if( move->m_sim_time > 0.f && !move->dormant( ) && !record->dormant( ) ) {
vec3_t delta = move->m_origin - record->m_origin;
// check if moving record is close.
if( delta.length_2d( ) <= 128.f ) {
// indicate that we are using the moving lby.
data->m_moved = true;
}
}
LagRecord* previous_record = nullptr;
// check
if (data->m_records.size() >= 2)
previous_record = data->m_records[1].get();
if (previous_record && record->m_body != previous_record->m_body) {
// only shoot the LBY flick 3 times.
// if we happen to miss then we most likely mispredicted
if (data->m_body_index < 2) {
// set angles to current LBY.
record->m_eye_angles.y = record->m_body;
// predict next body update.
data->m_body_update = record->m_anim_time + 1.1f;
// set the resolve mode.
resolver_state[record->m_player->index()] = XOR("LBY UPDATE");
record->m_mode = Modes::RESOLVE_BODY;
return;
}
}
// a valid moving context was found
if(data->m_moved) {
record->m_mode = Modes::RESOLVE_STAND;
ang_t ang;
bool is_backwards_test = fabsf(math::angle_diff(move->m_body, away + 180.0f)) <= 22.f;
if (data->m_stand_index == 0)
{
auto& freestanding = data->freestanding;
if (freestanding.available && IsYawSideways(record, move->m_body))
{
if (freestanding.left_damage <= 0 && freestanding.right_damage <= 0)
{
if (freestanding.right_fraction < freestanding.left_fraction)
freestanding.yaw = away + 90.f;
else if (freestanding.right_fraction > freestanding.left_fraction)
freestanding.yaw = away - 90.f;
}
else
{
if (freestanding.left_damage > freestanding.right_damage)
freestanding.yaw = away + 90.f;
else if (freestanding.left_damage < freestanding.right_damage)
freestanding.yaw = away - 90.f;
}
record->m_eye_angles.y = math::NormalizedAngle(freestanding.yaw);
resolver_state[record->m_player->index()] = XOR("FREESTANDING");
}
else
{
is_backwards_test ? resolver_state[record->m_player->index()] = XOR("BACKWARDS") : g_hvh.DoEdgeAntiAim(data->m_player, ang) ? resolver_state[record->m_player->index()] = XOR("EDGE") : resolver_state[record->m_player->index()] = XOR("LASTMOVING LBY");
is_backwards_test ? record->m_eye_angles.y = away + 180.f : g_hvh.DoEdgeAntiAim(data->m_player, ang) ? record->m_eye_angles.y = ang.y : record->m_eye_angles.y = move->m_body;
}
}
if( data->m_stand_index > 0 ) {
switch( data->m_stand_index % 6 ) {
case 0:
record->m_eye_angles.y = away + 70.f;
resolver_state[ record->m_player->index( ) ] = XOR( "1" );
break;
case 1:
record->m_eye_angles.y = away - 70.f;
resolver_state[ record->m_player->index( ) ] = XOR( "2" );
break;
case 2:
record->m_eye_angles.y = away;
resolver_state[ record->m_player->index( ) ] = XOR( "3" );
break;
case 3:
record->m_eye_angles.y = record->m_body;
resolver_state[ record->m_player->index( ) ] = XOR( "4" );
break;
case 4:
record->m_eye_angles.y = record->m_body + 180.f;
resolver_state[ record->m_player->index( ) ] = XOR( "5" );
break;
case 5:
record->m_eye_angles.y = move->m_body + 180.f;
resolver_state[ record->m_player->index( ) ] = XOR( "6" );
break;
default:
break;
}
}
return;
}
else {
record->m_mode = Modes::RESOLVE_STAND2;
switch (data->m_stand_index2 % 7) {
case 0:
AntiFreestand(record);
resolver_state[record->m_player->index()] = XOR("FREESTAND");
break;
case 1:
record->m_eye_angles.y = away + 180.f;
resolver_state[record->m_player->index()] = XOR("BACKWARDS");
break;
case 2:
record->m_eye_angles.y = data->m_body;
resolver_state[record->m_player->index()] = XOR("LBY");
break;
case 3:
record->m_eye_angles.y = data->m_body + 180.f;
resolver_state[record->m_player->index()] = XOR("REVERSED LBY");
break;
case 4:
record->m_eye_angles.y = data->m_body + 90.f;
resolver_state[record->m_player->index()] = XOR("LBY(+)");
break;
case 5:
record->m_eye_angles.y = data->m_body - 90.f;
resolver_state[record->m_player->index()] = XOR("LBY(-)");
break;
case 6:
record->m_eye_angles.y = away;
resolver_state[record->m_player->index()] = XOR("EDGE");
break;
default:
break;
}
}
}
Последнее редактирование: