From 716be28826ac61491944490373402c39123a1d75 Mon Sep 17 00:00:00 2001 From: navewindre Date: Mon, 3 Dec 2018 22:03:34 +0100 Subject: boris is cool --- cheat/internal_rewrite/c_base_player.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'cheat/internal_rewrite/c_base_player.cpp') diff --git a/cheat/internal_rewrite/c_base_player.cpp b/cheat/internal_rewrite/c_base_player.cpp index 11882ea..b24e7b5 100644 --- a/cheat/internal_rewrite/c_base_player.cpp +++ b/cheat/internal_rewrite/c_base_player.cpp @@ -612,7 +612,7 @@ void c_base_player::do_ent_interpolation( bool reset ) { set_abs_origin( vec_lerp ); invalidate_bone_cache( ); - ce( )->SetupBones( anim_data->m_bones, 128, BONE_USED_BY_ANYTHING, g_csgo.m_globals->m_curtime ); + ce( )->SetupBones( nullptr, -1, BONE_USED_BY_ANYTHING, g_csgo.m_globals->m_curtime ); this->m_iMostRecentModelBoneCounter( )++; *( byte* )( uintptr_t( this ) + 0x270 ) = backup; @@ -665,7 +665,7 @@ void c_base_player::calc_anim_velocity( bool reset ) { } //guess how many fucks i give, this works - accelspeed = std::min( accel * 10.f * TICK_INTERVAL( ) * std::max( speed, 250.f ), currentspeed ); + accelspeed = std::min( accel * 10.f * TICK_INTERVAL( ) * speed, currentspeed ); for( size_t i{ }; i < 3; ++i ) { velocity[ i ] += accelspeed * direction[ i ]; @@ -741,17 +741,21 @@ void c_base_player::calc_anim_velocity( bool reset ) { if( anim_vel.length2d( ) < 1.f ) anim_vel = vec3_t( ); - int ticks = TIME_TO_TICKS( delta * 0.5f ); - vec3_t est_tick_vel = math::lerp( last_velocity, velocity, .5f ); - for( int i{ }; i < ticks + 1; i++ ) { - if( est_tick_vel.length2d( ) < 5.f ) - break; + int ticks = TIME_TO_TICKS( delta ); + vec3_t est_tick_vel = last_velocity; + + for( int i{ }; i < ticks; i++ ) { + est_tick_vel = friction( est_tick_vel ); + + if( i <= ticks / 2 ) { + accelerate( anim_vel, wishdir, m_fFlags( ) & FL_DUCKING ? 83.3333333f : 250.f, sv_accelerate->get_float( ) ); + } 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( ) ); + anim_vel = accelerate( anim_vel, wishdir, m_fFlags( ) & FL_DUCKING ? 83.3333333f : 250.f, sv_accelerate->get_float( ) ); //assume fakewalk if( anim_vel.length2d( ) >= sm_animdata[ idx ].m_anim_velocity.length2d( ) && est_tick_vel.length2d( ) < 5.f && delta > TICK_INTERVAL( ) ) @@ -926,7 +930,7 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) { TICK_INTERVAL( ) / ( m_flSimulationTime( ) - m_flOldSimulationTime( ) ) ); if( !reset ) { - m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle = prev_cycle + lerp_rate; + //m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle = prev_cycle + lerp_rate; } get_animdata( ).m_prev_flags = flags; -- cgit v1.2.3