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.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/internal_rewrite/lag_mgr.cpp b/internal_rewrite/lag_mgr.cpp
index 0c67a3c..0233e4a 100644
--- a/internal_rewrite/lag_mgr.cpp
+++ b/internal_rewrite/lag_mgr.cpp
@@ -74,21 +74,19 @@ namespace features
if( settings.fluctuate )
max_ticks *= last_rand;
-#ifdef _DEBUG
+ static bool changed = false;
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
+ if( !changed ) {
+ 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 );
+ }
+ changed = true;
-#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 ) {