From 89d0110da2e65405fcbdac0e24f4fcc5cdce4c1c Mon Sep 17 00:00:00 2001 From: navewindre Date: Sat, 1 Sep 2018 17:54:45 +0200 Subject: uh --- internal_rewrite/update_clientside_animation.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'internal_rewrite/update_clientside_animation.cpp') diff --git a/internal_rewrite/update_clientside_animation.cpp b/internal_rewrite/update_clientside_animation.cpp index e05d6c2..009250b 100644 --- a/internal_rewrite/update_clientside_animation.cpp +++ b/internal_rewrite/update_clientside_animation.cpp @@ -43,11 +43,20 @@ void __fastcall hooks::update_clientside_animation( void* ecx_, void* edx_ ) { vec3_t real_angle = g_ctx.m_thirdperson_angle; - float min_pitch = 10.0f; + float pitch; if( g_ctx.m_local->get_animstate( )->m_bInHitGroundAnimation && ( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) ) { - if( real_angle.x > min_pitch ) { - real_angle.x = -min_pitch; + bool dist = g_settings.rage.enabled( ) && g_settings.rage.selection_type( ) == 1; + int target = util::get_closest_player( dist ); + + if( target != -1 ) { + auto t = g_csgo.m_entlist( )->GetClientEntity( target ); + + pitch = math::vector_angles( ent->m_vecOrigin( ), t->m_vecOrigin( ) ).x; } + else + pitch = -10.f; + + real_angle.x = pitch; } g_csgo.m_prediction( )->SetViewAngles( real_angle ); -- cgit v1.2.3