-
Автор темы
- #1
C++:
void Movement::FixMove(CUserCmd* cmd, ang_t& wanted_move, bool a7)
{
float y; // xmm3_4
float v9; // xmm4_4
float x; // xmm0_4
float v11; // xmm3_4
float v12; // xmm4_4
float v13; // xmm0_4
float v14; // xmm5_4
float v15; // xmm5_4
float v16; // xmm5_4
float v17; // xmm7_4
float v18; // xmm6_4
float v19; // xmm3_4
float v21; // [esp+Ch] [ebp-74h]
float v22; // [esp+Ch] [ebp-74h]
float z; // [esp+10h] [ebp-70h]
float v24; // [esp+10h] [ebp-70h]
float v25; // [esp+14h] [ebp-6Ch]
float v26; // [esp+14h] [ebp-6Ch]
float v27; // [esp+18h] [ebp-68h]
float v28; // [esp+1Ch] [ebp-64h]
float v29; // [esp+20h] [ebp-60h]
float v30; // [esp+24h] [ebp-5Ch]
float v31; // [esp+28h] [ebp-58h]
float v32; // [esp+28h] [ebp-58h]
float v33; // [esp+2Ch] [ebp-54h]
float v34; // [esp+30h] [ebp-50h]
float v35; // [esp+34h] [ebp-4Ch]
float v36; // [esp+38h] [ebp-48h]
float v37; // [esp+40h] [ebp-40h]
ang_t input; // [esp+44h] [ebp-3Ch] BYREF
vec3_t forward; // [esp+50h] [ebp-30h] BYREF
vec3_t right; // [esp+5Ch] [ebp-24h] BYREF
ang_t v41; // [esp+68h] [ebp-18h] BYREF
vec3_t up; // [esp+74h] [ebp-Ch] BYREF
input = wanted_move;
v41 = cmd->m_view_angles;
if (wanted_move == v41)
return;
const float move_magnitude = std::sqrt((cmd->m_forward_move * cmd->m_forward_move) + (cmd->m_side_move * cmd->m_side_move));
if (move_magnitude == 0.f)
return;
if (g_cl.m_local->m_MoveType() == 8
|| g_cl.m_local->m_MoveType() == 9)
return;
math::AngleVectors(input, &forward, &right, &up);
y = forward.y;
z = forward.z;
v37 = 1.f;
if (forward.z == 0.f)
x = forward.x;
else {
z = 0.f;
v9 = forward.length_2d();
if (v9 >= 0.00000011920929f) {
y = forward.y * (1.f / v9);
v35 = forward.x * (1.f / v9);
goto LABEL_13;
}
y = 0.f;
x = 0.f;
}
v35 = x;
LABEL_13:
v36 = y;
v11 = right.y;
v31 = right.z;
if (right.z == 0.0) {
v13 = right.x;
goto LABEL_18;
}
v31 = 0.f;
v12 = right.length_2d();
if (v12 < 0.00000011920929f) {
v11 = 0.f;
v13 = 0.f;
LABEL_18:
v21 = v13;
goto LABEL_19;
}
v11 = right.y * (1.f / v12);
v21 = right.x * (1.f / v12);
LABEL_19:
if (up.z < 0.00000011920929f)
v25 = 0.f;
else
v25 = 1.f;
if (v41.z == 180.0 && !a7)
cmd->m_forward_move = std::abs(cmd->m_forward_move);
math::AngleVectors(v41, &right, &forward, &up);
v33 = right.z;
if (right.z == 0.f) {
v27 = right.y;
v28 = right.x;
}
else {
v33 = 0.f;
v14 = right.length_2d();
if (v14 < 0.00000011920929f) {
v27 = 0.f;
v28 = 0.f;
}
else
{
v28 = right.x * (1.f / v14);
v27 = right.y * (1.f / v14);
}
}
v34 = forward.z;
if (forward.z == 0.0) {
v29 = forward.y;
v30 = forward.x;
}
else {
v34 = 0.f;
v15 = forward.length_2d();
if (v15 < 0.00000011920929f) {
v29 = 0.f;
v30 = 0.f;
}
else {
v30 = forward.x * (1.f / v15);
v29 = forward.y * (1.f / v15);
}
}
if (up.z < 0.00000011920929f)
v37 = 0.f;
v16 = v11 * cmd->m_side_move;
v24 = z * cmd->m_forward_move;
v22 = v21 * cmd->m_side_move;
v17 = v35 * cmd->m_forward_move;
v18 = v36 * cmd->m_forward_move;
v26 = v25 * cmd->m_up_move;
v32 = v31 * cmd->m_side_move;
v19 = cmd->m_up_move * 0.f;
cmd->m_forward_move = ((((v16 * v27) + (v22 * v28)) + (v32 * v33)) + (((v18 * v27) + (v17 * v28)) + (v24 * v33))) + (((v19 * v27) + (v19 * v28)) + (v26 * v33));
cmd->m_side_move = ((((v16 * v29) + (v22 * v30)) + (v32 * v34)) + (((v18 * v29) + (v17 * v30)) + (v24 * v34))) + (((v19 * v29) + (v19 * v30)) + (v26 * v34));
cmd->m_up_move = ((((v16 * 0.f) + (v22 * 0.f)) + (v32 * v37)) + (((v18 * 0.f) + (v17 * 0.f)) + (v24 * v37))) + (((v19 * 0.f) + (v19 * 0.f)) + (v26 * v37));
}
C++:
if( *m_packet ) {
m_cmds.push_back( cmd->m_command_number );
}
else {
g_csgo.m_net->SendDatagram( nullptr );
--g_csgo.m_net->m_choked_packets;
--g_csgo.m_net->m_out_seq;
}
C++:
void Resolver::skeet_match_shot( AimPlayer* data, LagRecord* record ) {
if( !record->m_weapon )
return;
WeaponInfo* wpn_data = record->m_weapon->GetWpnData( );
if( !wpn_data )
return;
if ( ( wpn_data->m_weapon_type != WEAPONTYPE_GRENADE
&& wpn_data->m_weapon_type > WEAPONTYPE_MACHINEGUN )
|| wpn_data->m_weapon_type <= WEAPONTYPE_KNIFE )
return;
const float shot_time = record->m_weapon->m_fLastShotTime( );
const int shot_tick = game::TIME_TO_TICKS( shot_time );
const int max_process = g_csgo.sv_maxusrcmdprocessticks->GetInt( );
const int sim_tick = game::TIME_TO_TICKS( record->m_sim_time );
const int old_sim_tick = game::TIME_TO_TICKS( record->m_old_sim_time );
int choked_ticks = sim_tick - old_sim_tick;
if( choked_ticks >= 0 ) {
if( choked_ticks > max_process )
choked_ticks = max_process;
}
else
choked_ticks = 0;
int oldest_tick = old_sim_tick;
if( ( old_sim_tick + choked_ticks ) != sim_tick )
oldest_tick = ( sim_tick - choked_ticks );
int newest_tick = sim_tick;
int shot_type = shot_type_t::SHOT_NONE;
if( choked_ticks > 0 ) {
if( shot_tick > oldest_tick && shot_tick <= newest_tick ) {
shot_type = shot_type_t::SHOT_FAKE;
if( shot_tick == newest_tick )
shot_type = shot_type_t::SHOT_REAL;
/*g_cl.print( "[ shot ] choke: %i | type: %i | shot: %i | new: %i | old: %i\n", choked_ticks, shot_type, shot_tick, newest_tick, oldest_tick );*/
}
}
if( shot_type == shot_type_t::SHOT_FAKE && !record->shift_type( ) ) {
float valid_pitch = 89.f;
for( const auto& it : data->m_records ) {
if( it->m_shot_type == shot_type_t::SHOT_NONE ) {
valid_pitch = it->m_eye_angles.x;
break;
}
}
record->m_eye_angles.x = valid_pitch;
}
}