summaryrefslogtreecommitdiff
path: root/internal_rewrite/update_clientside_animation.cpp
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2018-09-01 17:54:45 +0200
committernavewindre <boneyaard@gmail.com>2018-09-01 17:54:45 +0200
commit89d0110da2e65405fcbdac0e24f4fcc5cdce4c1c (patch)
treefc33ee66cfc1b104c355391386abfccf1e5b94ea /internal_rewrite/update_clientside_animation.cpp
parentaeef9e6d8241b4f7451a26f5af9645c1a6e5c4d9 (diff)
uh
Diffstat (limited to 'internal_rewrite/update_clientside_animation.cpp')
-rw-r--r--internal_rewrite/update_clientside_animation.cpp15
1 files changed, 12 insertions, 3 deletions
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 );