summaryrefslogtreecommitdiff
path: root/internal_rewrite/lag_mgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'internal_rewrite/lag_mgr.cpp')
-rw-r--r--internal_rewrite/lag_mgr.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/internal_rewrite/lag_mgr.cpp b/internal_rewrite/lag_mgr.cpp
index 9189345..0c67a3c 100644
--- a/internal_rewrite/lag_mgr.cpp
+++ b/internal_rewrite/lag_mgr.cpp
@@ -74,7 +74,21 @@ namespace features
if( settings.fluctuate )
max_ticks *= last_rand;
+#ifdef _DEBUG
+ static auto cl_sendmove = pattern::first_code_match( g_csgo.m_engine.dll( ), xors( "55 8B EC A1 ? ? ? ? 81 EC ? ? ? ? B9 ? ? ? ? 53 8B 98" ), 0 );
+
+ ulong_t old;
+ VirtualProtect( ( void* )( cl_sendmove + 0xbd ), 1, PAGE_EXECUTE_READWRITE, &old );
+ *( uint8_t* )( cl_sendmove + 0xbd ) = 50;
+ VirtualProtect( ( void* )( cl_sendmove + 0xbd ), 1, old, nullptr );
+#endif
+
+
+#ifndef _DEBUG
max_ticks = math::min( max_ticks, 14 );
+#else
+ max_ticks = math::min( max_ticks, 16 );
+#endif
bool force_send = m_held_ticks >= max_ticks;
if( settings.mode == 1 ) {
@@ -166,13 +180,13 @@ namespace features
}
static int wep_choke = 0;
+ if( wep_choke )
+ send = !--wep_choke;
+
if( m_cmd->m_weaponselect && settings.on_select ) {
wep_choke = max_ticks;
}
- if( wep_choke )
- send = !--wep_choke;
-
if( ( m_cmd->m_buttons & IN_ATTACK ) && g_ctx.m_local->can_attack( ) &&
!settings.in_attack ) {
if( !weapon->is_grenade( ) || ( weapon->is_grenade( ) && weapon->m_fThrowTime( ) < TICK_INTERVAL( ) ) ) {
@@ -182,7 +196,7 @@ namespace features
*m_sendpacket = ( send || force_send ) && !get_sent( );
if( *m_sendpacket ) {
- m_breaking_lc = delta.length2dsqr( ) > 4096.f;
+ m_breaking_lc = delta.length2d( ) > 64.f;
last_rand = ( 1.f + math::random_number( -settings.fluctuate, settings.fluctuate( ) ) * 0.01f );
}
}