summaryrefslogtreecommitdiff
path: root/cheat/internal_rewrite/ragebot_lagcomp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cheat/internal_rewrite/ragebot_lagcomp.cpp')
-rw-r--r--cheat/internal_rewrite/ragebot_lagcomp.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/cheat/internal_rewrite/ragebot_lagcomp.cpp b/cheat/internal_rewrite/ragebot_lagcomp.cpp
index 5014143..ba1cc43 100644
--- a/cheat/internal_rewrite/ragebot_lagcomp.cpp
+++ b/cheat/internal_rewrite/ragebot_lagcomp.cpp
@@ -208,15 +208,22 @@ namespace features
float delta = ent->m_flSimulationTime( ) - ent->m_flOldSimulationTime( );
new_record.m_globaltime = g_csgo.m_globals->m_curtime;
- if( g_settings.legit.enabled( ) )
- new_record.m_globaltime -= TICK_INTERVAL( );
+ new_record.m_globaltime -= util::get_lerptime( );
new_record.m_validtime = 0.f;
- if( ent->ce( )->SetupBones( new_record.m_matrix, 128, BONE_USED_BY_ANYTHING, 0.f ) ) {
- data.push_front( new_record );
+ matrix3x4 matrix[ 128 ];
+ ent->ce( )->SetupBones( matrix, 128, BONE_USED_BY_ANYTHING, 0.f );
+
+ for( size_t i{ }; i < 128; ++i ) {
+ vec3_t delta = math::get_matrix_position( matrix[ i ] ) - ent->m_vecOrigin( );
+ math::set_matrix_position( delta + ent->m_vecOrigin( ), matrix[ i ] );
}
+ memcpy( new_record.m_matrix, matrix, sizeof( matrix ) );
+
+ data.push_front( new_record );
+
last_simtime[ i ] = ent->m_flSimulationTime( );
}
@@ -258,7 +265,7 @@ namespace features
auto next_record = ( it + 1 );
if( std::abs( it->m_simtime - ent->m_flSimulationTime( ) ) > TIME_TO_TICKS( 16 ) )
- break;
+ continue;
if( !it->m_validtime )
it->m_validtime = g_csgo.m_globals->m_curtime;
@@ -275,9 +282,14 @@ namespace features
float curtime = g_csgo.m_globals->m_curtime;
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 = 1 + pow( delta - 1, 3 );
vec3_t next = ( it + 1 ) == data.rend( ) ? ent->m_vecOrigin( ) : ( it + 1 )->m_origin;
- vec3_t lerp = math::lerp( it->m_origin, next, std::clamp( delta, 0.f, 1.f ) );
+ vec3_t lerp = math::lerp( it->m_origin, next, delta );
matrix3x4 ret[ 128 ];