From b1cd9458f103d99f4de1807f512ed9ffd2e38220 Mon Sep 17 00:00:00 2001 From: navewindre Date: Wed, 19 Sep 2018 21:51:56 +0200 Subject: dsad --- internal_rewrite/c_base_player.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'internal_rewrite/c_base_player.cpp') diff --git a/internal_rewrite/c_base_player.cpp b/internal_rewrite/c_base_player.cpp index eed90e0..07a90be 100644 --- a/internal_rewrite/c_base_player.cpp +++ b/internal_rewrite/c_base_player.cpp @@ -566,6 +566,9 @@ void c_base_player::do_ent_interpolation( bool reset ) { if( !lerp ) return; + if( anim_data->m_last_interp_origin.dist_to( anim_data->m_interp_origin ) > 64.f ) + return; + for( size_t i{ }; i < 3; ++i ) { if( !std::isfinite( anim_data->m_last_interp_origin[ i ] ) || !std::isfinite( anim_data->m_interp_origin[ i ] ) ) { char error_msg[ 128 ]; @@ -742,13 +745,12 @@ void c_base_player::calc_anim_velocity( bool reset ) { est_tick_vel = friction( est_tick_vel ); } + if( velocity.length2d( ) > last_velocity.length2d( ) ) + anim_vel = accelerate( anim_vel, wishdir, 250.f, sv_accelerate->get_float( ) ); + //assume fakewalk - if( velocity.length2d( ) >= last_velocity.length2d( ) && est_tick_vel.length2d( ) < 5.f && delta > TICK_INTERVAL( ) ) + if( anim_vel.length2d( ) >= sm_animdata[ idx ].m_anim_velocity.length2d( ) && est_tick_vel.length2d( ) < 5.f && delta > TICK_INTERVAL( ) ) anim_vel = vec3_t( ); - - else if( anim_vel.length2d( ) >= 0.1f && velocity.length2d( ) > last_velocity.length2d( ) ) { - anim_vel = accelerate( anim_vel, wishdir, 250.f, sv_accelerate->get_float( ) ); - } } else { anim_vel = math::lerp( -- cgit v1.2.3