From 3d412a4b30a9f7c7f51ea6562e694315948bd3da Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 28 Nov 2018 16:00:02 +1300 Subject: cleaned up in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever. i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64 --- cheat/gmod/lag_mgr.cpp | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 cheat/gmod/lag_mgr.cpp (limited to 'cheat/gmod/lag_mgr.cpp') diff --git a/cheat/gmod/lag_mgr.cpp b/cheat/gmod/lag_mgr.cpp new file mode 100644 index 0000000..4f9d04b --- /dev/null +++ b/cheat/gmod/lag_mgr.cpp @@ -0,0 +1,79 @@ +#include "lag_mgr.hpp" +#include "c_base_player.hpp" +#include "context.hpp" +#include "interface.hpp" +#include "base_cheat.hpp" + +namespace features +{ + void c_lagmgr::on_antiaim( ) { + static bool lag_flip{ }; //fuck you and ur cmdnr + *m_sendpacket = lag_flip; + lag_flip ^= 1; + + if( m_sent_ticks ) { + *m_sendpacket = false; + } + } + + + void c_lagmgr::fakelag( ) { + //2017 sucked + //i hope 2018 goes better + + if( !g_settings.rage.fakelag.mode( ) || + !g_settings.rage.fakelag.ticks( ) ) { + m_breaking_lc = false; + return; + } + + auto& settings = g_settings.rage.fakelag; + + if( g_ctx.m_local->m_vecVelocity( ).length( ) < 0.1f ) { + return; + } + + vec3_t delta = g_ctx.m_last_origin - g_ctx.m_local->m_vecOrigin( ); + int max_ticks = math::min( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ? 10 : 16, g_settings.rage.fakelag.ticks( ) ); + bool force_send = m_held_ticks > max_ticks; + if( settings.mode == 1 ) { + if( delta.length2dsqr( ) > 4096.f ) { + force_send = get_choked( ) > 3; + } + } + + if( settings.mode == 2 ) { + auto fluc = math::random_number( -settings.fluctuate( ), settings.fluctuate( ) ) * 0.01f; + force_send = m_held_ticks > math::min( max_ticks + ( int )fluc, 15 ); + } + + bool send = false; + static bool was_onground{ }; + + if( !settings.in_move ) { + send = true; + } + + if( settings.in_air && !( g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) ) { + send = false; + } + + if( settings.avoid_ground ) { + if( !was_onground && g_ctx.m_local->m_fFlags( ) & FL_ONGROUND ) { + send = false; + } + } + + was_onground = g_ctx.m_local->m_fFlags( ) & FL_ONGROUND; + + if( ( m_cmd->m_buttons & IN_ATTACK ) && + !settings.in_attack ) { + send = true; + } + + *m_sendpacket = ( send || force_send ) && !get_sent( ); + if( *m_sendpacket ) { + m_breaking_lc = delta.length2dsqr( ) > 4096.f; + } + } +} \ No newline at end of file -- cgit v1.2.3