From bca49754578cd6c002fa258f89fe85bb9966e9c1 Mon Sep 17 00:00:00 2001 From: navewindre Date: Wed, 5 Dec 2018 00:08:02 +0100 Subject: Auto stash before merge of "master" and "origin/master" --- cheat/internal_rewrite/c_base_player.cpp | 38 +++++++++++++++++++----------- cheat/internal_rewrite/listener.cpp | 2 +- cheat/internal_rewrite/packet_start.cpp | 1 + cheat/internal_rewrite/ragebot_lagcomp.cpp | 2 +- cheat/internal_rewrite/ui.h | 24 +++++++++---------- cheat/internal_rewrite/visual_local.cpp | 4 ++++ 6 files changed, 43 insertions(+), 28 deletions(-) diff --git a/cheat/internal_rewrite/c_base_player.cpp b/cheat/internal_rewrite/c_base_player.cpp index b24e7b5..3ace4ab 100644 --- a/cheat/internal_rewrite/c_base_player.cpp +++ b/cheat/internal_rewrite/c_base_player.cpp @@ -720,7 +720,7 @@ void c_base_player::calc_anim_velocity( bool reset ) { vec3_t anim_vel; - if( on_ground ) { + if( on_ground && !( m_fFlags( ) & FL_ONGROUND ) ) { vec3_t ang = math::vector_angles( vec3_t( ), velocity ); float move_yaw = math::vector_angles( velocity ).y; @@ -747,18 +747,16 @@ void c_base_player::calc_anim_velocity( bool reset ) { 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( ) ); + if( i <= ticks * 0.75f ) { + accelerate( anim_vel, wishdir, 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, m_fFlags( ) & FL_DUCKING ? 83.3333333f : 250.f, sv_accelerate->get_float( ) ); + anim_vel = accelerate( anim_vel, wishdir, 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( ) ) + if( anim_vel.length2d( ) >= sm_animdata[ idx ].m_anim_velocity.length2d( ) && est_tick_vel.length2d( ) < 1.f && delta > TICK_INTERVAL( ) ) anim_vel = vec3_t( ); } else { @@ -816,6 +814,8 @@ void c_base_player::fix_jump_fall( bool reset ) { void c_base_player::fix_animations( bool reset, bool resolver_change ) { //todo: legs dont match up when fakelagging <- not anymore int idx = ce( )->GetIndex( ); + + bool was_valid = sm_animdata[ idx ].m_valid; sm_animdata[ idx ].m_valid = false; if( !get_animstate( ) ) @@ -921,17 +921,27 @@ void c_base_player::fix_animations( bool reset, bool resolver_change ) { } sm_animdata[ idx ].m_last_animtime = get_animstate( )->m_flLastClientSideAnimationUpdateTime; - get_animstate( )->update( eye_angles.y, eye_angles.x ); m_AnimOverlay( ).GetElements( )[ 6 ].m_flPrevCycle = m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle; + get_animstate( )->update( eye_angles.y, eye_angles.x ); - float lerp_rate = math::lerp( - prev_rate, - m_AnimOverlay( ).GetElements( )[ 6 ].m_flPlaybackRate, - TICK_INTERVAL( ) / ( m_flSimulationTime( ) - m_flOldSimulationTime( ) ) ); + if( was_valid && !reset ) { + float lerp_rate = math::lerp( + prev_rate, + m_AnimOverlay( ).GetElements( )[ 6 ].m_flPlaybackRate, + 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; } + else if( !reset ) { + float cycle = m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle; + float rate = m_AnimOverlay( ).GetElements( )[ 6 ].m_flPlaybackRate; + + float est_cycle = cycle - rate + ( rate * TICK_INTERVAL( ) / ( m_flSimulationTime( ) - m_flOldSimulationTime( ) ) ); + + m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle = est_cycle; + } + + m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle = std::fmod( m_AnimOverlay( ).GetElements( )[ 6 ].m_flCycle, 1.0f ); get_animdata( ).m_prev_flags = flags; memcpy( diff --git a/cheat/internal_rewrite/listener.cpp b/cheat/internal_rewrite/listener.cpp index eb5caf4..22b691a 100644 --- a/cheat/internal_rewrite/listener.cpp +++ b/cheat/internal_rewrite/listener.cpp @@ -123,6 +123,7 @@ namespace listeners shot.m_handled = true; shot.m_logged = false; shot.m_damage = dmg; + g_cheat.m_visuals.store_hit( &shot ); } else if( g_settings.misc.log_hits( ) ) { char print_str[ 100 ]; @@ -133,7 +134,6 @@ namespace listeners } if( shot.m_enemy_index ) { - g_cheat.m_visuals.store_hit( &shot ); //g_cheat.m_visuals.store_shot( shot.m_enemy_pos, true ); } } diff --git a/cheat/internal_rewrite/packet_start.cpp b/cheat/internal_rewrite/packet_start.cpp index a5c9db4..c24e722 100644 --- a/cheat/internal_rewrite/packet_start.cpp +++ b/cheat/internal_rewrite/packet_start.cpp @@ -3,6 +3,7 @@ void __fastcall hooks::packet_start( void* ecx, void* edx, int in_seq, int out_ack ) { if( !g_ctx.run_frame( ) || !g_ctx.m_local->is_valid( ) ) { + g_ctx.m_cmd_numbers.clear( ); *( int* )( uintptr_t( ecx ) + 0x114 ) = in_seq; *( int* )( uintptr_t( ecx ) + 0x4cb4 ) = out_ack; } diff --git a/cheat/internal_rewrite/ragebot_lagcomp.cpp b/cheat/internal_rewrite/ragebot_lagcomp.cpp index e73eda4..0c4bc1b 100644 --- a/cheat/internal_rewrite/ragebot_lagcomp.cpp +++ b/cheat/internal_rewrite/ragebot_lagcomp.cpp @@ -283,7 +283,7 @@ namespace features float delta = ( curtime - it->m_validtime ) / lerptime; delta = std::clamp( delta, 0.f, 1.f ); - + //EASE OUT BY NAVEWINDRE DO NOT STEAL if( lerptime > 0.075f ) delta = math::ease_out( 0.f, 1.f, delta ); diff --git a/cheat/internal_rewrite/ui.h b/cheat/internal_rewrite/ui.h index 484868b..4232ef0 100644 --- a/cheat/internal_rewrite/ui.h +++ b/cheat/internal_rewrite/ui.h @@ -41,18 +41,18 @@ namespace ui const auto username_hash = hash::fnv1a(g_header.username); - const char* menu_titles[] = { - xors("hit p hack"), - xors("bitcoin miner"), - xors("dmt hook"), - xors("currency robot"), - xors("automated currency"), - xors("retard remover"), - xors("sse2 wall hack"), - xors("premium csgo aimbot"), - xors("friendlyhack"), - xors("[insert word] windre hack"), - xors("jake > sparkle hack"), + const char* menu_titles[] = { + xors("hit p hack"), + xors("bitcoin miner"), + xors("dmt hook"), + xors("currency robot"), + xors("automated currency"), + xors("retard remover"), + xors("sse2 wall hack"), + xors("premium csgo aimbot"), + xors("friendly hack"), + xors("[insert word] windre hack"), + xors("jake > sparkle hack"), }; menu = std::make_shared< ui::c_menu >( 10, 10, 580, 470, menu_titles[username_hash & 10], diff --git a/cheat/internal_rewrite/visual_local.cpp b/cheat/internal_rewrite/visual_local.cpp index e6c6d4b..9457950 100644 --- a/cheat/internal_rewrite/visual_local.cpp +++ b/cheat/internal_rewrite/visual_local.cpp @@ -23,6 +23,10 @@ namespace features int screen_w, screen_h; g_csgo.m_engine( )->GetScreenSize( screen_w, screen_h ); + // idk why but i hate csgo + if( screen_w < 100 ) + return; + const float degree_offset = 80.f; static std::vector< flake > flakes; -- cgit v1.2.3