From cf4d2ec1a220d70bcfb6490a1a4e23dc8d90886b Mon Sep 17 00:00:00 2001 From: navewindre Date: Tue, 4 Sep 2018 19:10:21 +0200 Subject: gay --- internal_rewrite/c_base_player.cpp | 9 ++++++++- internal_rewrite/proxies.cpp | 34 +++++----------------------------- internal_rewrite/simple_settings.hpp | 6 ++++-- 3 files changed, 17 insertions(+), 32 deletions(-) diff --git a/internal_rewrite/c_base_player.cpp b/internal_rewrite/c_base_player.cpp index 24f75cd..a96a4b4 100644 --- a/internal_rewrite/c_base_player.cpp +++ b/internal_rewrite/c_base_player.cpp @@ -874,9 +874,16 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) { float prev_cycle = m_AnimOverlay( ).GetElements( )[ 6 ].m_flPrevCycle; float prev_rate = m_AnimOverlay( ).GetElements( )[ 6 ].m_flPlaybackRate; + get_animstate( )->update( eye_angles.y, eye_angles.x ); m_AnimOverlay( ).GetElements( )[ 6 ].m_flPrevCycle = m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle; - m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle = prev_cycle + prev_rate; + + float lerp_rate = math::lerp( + prev_rate, + m_AnimOverlay( ).GetElements( )[ 6 ].m_flPlaybackRate, + TICK_INTERVAL( ) / ( m_flSimulationTime( ) - m_flOldSimulationTime( ) ) ); + + m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle = prev_cycle + lerp_rate; get_animdata( ).m_prev_flags = flags; diff --git a/internal_rewrite/proxies.cpp b/internal_rewrite/proxies.cpp index d214751..a42bf87 100644 --- a/internal_rewrite/proxies.cpp +++ b/internal_rewrite/proxies.cpp @@ -105,36 +105,12 @@ void __cdecl hooks::last_shot_proxy_fn( const CRecvProxyData* proxy_data_const, void __cdecl hooks::simtime_proxy_fn( const CRecvProxyData* proxy_data_const, void* entity, void* output ) { auto old_fn = simtime_proxy.get_old_function( ); - /*auto ent = ( c_base_player* )( entity ); + auto ent = ( c_base_player* )( entity ); if( ent && ent->is_valid( ) && ent->has_valid_anim( ) && ( ent->m_iTeamNum( ) != g_ctx.m_local->m_iTeamNum( ) || g_settings.rage.friendlies( ) ) && ent != g_ctx.m_local ) { - auto time = proxy_data_const->m_Value.m_Int; - auto id = proxy_data_const->m_ObjectID; - auto ptr = proxy_data_const->m_pRecvProp; - auto element = proxy_data_const->m_iElement; - - auto name = proxy_data_const->m_pRecvProp->GetName( ); - - //static float last_time[ 65 ]{ }; - - /*printf( "PROXY[ %d ]:\n" - "\tname: %s\n" - //"\tdelta: %f\n" - "\tm_Int: %d\n" - "\ttime: %f\n" - "\tid: %d\n" - "\tptr: %08x\n" - "\telement: %d\n", - ent->ce( )->GetIndex( ), - name, - //time - last_time[ ent->ce( )->GetIndex( ) ], - time, - ent->m_flSimulationTime( ), - id, - ptr, - element ); - - //last_time[ ent->ce( )->GetIndex( ) ] = ent->m_flSimulationTime( ); - }*/ + if( !proxy_data_const->m_Value.m_Int ) { + return; + } + } old_fn( proxy_data_const, entity, output ); } \ No newline at end of file diff --git a/internal_rewrite/simple_settings.hpp b/internal_rewrite/simple_settings.hpp index 6371992..8dcfaca 100644 --- a/internal_rewrite/simple_settings.hpp +++ b/internal_rewrite/simple_settings.hpp @@ -154,10 +154,11 @@ public: taken = true; } + memset( full_path, 0, MAX_PATH ); memcpy( full_path, str, MAX_PATH ); strcat_s< MAX_PATH >( full_path, file ); - simple_load( path, std::to_string( name_ ).c_str( ), &value_, sizeof( value_ ), str ); + simple_load( path, std::to_string( name_ ).c_str( ), &value_, sizeof( value_ ), full_path ); } __declspec( noinline ) void save( const char* path, const char* file ) const override { @@ -173,10 +174,11 @@ public: taken = true; } + memset( full_path, 0, MAX_PATH ); memcpy( full_path, str, MAX_PATH ); strcat_s< MAX_PATH >( full_path, file ); - simple_save( path, std::to_string( name_ ).c_str( ), &value_, sizeof( value_ ), str ); + simple_save( path, std::to_string( name_ ).c_str( ), &value_, sizeof( value_ ), full_path ); } __forceinline operator T&( ) { return value_; } -- cgit v1.2.3