summaryrefslogtreecommitdiff
path: root/cheat/internal_rewrite/c_base_player.cpp
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2018-12-03 22:03:34 +0100
committernavewindre <boneyaard@gmail.com>2018-12-03 22:03:41 +0100
commit716be28826ac61491944490373402c39123a1d75 (patch)
tree60614ff806843ccfde19c95bd28a8a25a230a54f /cheat/internal_rewrite/c_base_player.cpp
parent4047e9083ef1731847bcd75f361f2d611fe5e401 (diff)
boris is cool
Diffstat (limited to 'cheat/internal_rewrite/c_base_player.cpp')
-rw-r--r--cheat/internal_rewrite/c_base_player.cpp22
1 files changed, 13 insertions, 9 deletions
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;