From 90efebb3ba35a978d2d1fe551e18bfb7e9e2c480 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Sun, 9 Jul 2017 14:55:32 +0300 Subject: [PATCH] kinda fixed airstuck, added "infinite healthpacks" (work in progress) --- src/hacks/LagExploit.cpp | 26 ++++++++++++++++++++++++++ src/hooks/CreateMove.cpp | 2 +- src/hooks/others.cpp | 8 ++++---- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 7dee6ae6..4799835d 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -58,6 +58,7 @@ bool ExploitActive() { static CatVar mini_lag_exploit(CV_INT, "lagexploit_mini", "0", "Mini Lag Exploit"); static CatVar instant_weapon_switch(CV_SWITCH, "instant_weapon_switch", "0", "Instant weapon switch"); +static CatVar infinite_packs(CV_SWITCH, "infinite_healthpacks", "0", "Infinite Healthpacks", "Activate removecond when standing on healthpack while having not full HP"); void CreateMove() { if (CE_BAD(LOCAL_E)) return; @@ -145,6 +146,31 @@ void CreateMove() { if (!ExploitActive()) { amount = int(mini_lag_exploit); } + + // Infinite healthpacks (I'll probably have to move this somewhere else) + if (infinite_packs && CE_GOOD(LOCAL_E) && LOCAL_E->m_iHealth != LOCAL_E->m_iMaxHealth) { + ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable(); + const Vector& max1 = p->OBBMaxs(); + const Vector& min1 = p->OBBMins(); + for (int i = 1; i < entity_cache::max; i++) { + CachedEntity* e = ENTITY(i); + if (e->m_iClassID != CL_CLASS(CBaseAnimating)) continue; + if (e->m_ItemType != ITEM_HEALTH_SMALL && e->m_ItemType != ITEM_HEALTH_MEDIUM && e->m_ItemType != ITEM_HEALTH_LARGE) continue; + if (e->m_flDistance < 54.0f) amount = 900; + // Not working for some reason? + /*ICollideable* c = RAW_ENT(e)->GetCollideable(); + const Vector& max2 = c->OBBMaxs(); + const Vector& min2 = c->OBBMins(); + if ( (min1.x <= max2.x && max1.x >= min2.x) && + (min1.y <= max2.y && max1.y >= min2.y) && + (min1.z <= max2.z && max1.z >= min2.z) ) { + logging::Info("Collision with %d", i); + amount = 900; + break; + }*/ + } + } + if (!amount) return; // Modifying command_number and lastoutgoingcommand turned out to be useless diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 0b3d3fcb..24e88a22 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -356,7 +356,7 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) { if (CE_GOOD(g_pLocalPlayer->entity)) { static int fakelag_queue = 0; if (fakelag_amount) { - if (fakelag_queue == int(fakelag_amount)) { + if (fakelag_queue == int(fakelag_amount) || (g_pUserCmd->buttons & IN_ATTACK)) { *bSendPackets = true; } else if (fakelag_queue < int(fakelag_amount)) { *bSendPackets = false; diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index 40297113..9d3a0b20 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -169,15 +169,15 @@ bool SendNetMsg_hook(void* _this, INetMessage& msg, bool bForceReliable = false, } static ConVar* sv_player_usercommand_timeout = g_ICvar->FindVar("sv_player_usercommand_timeout"); static float lastcmd = 0.0f; - if (lastcmd > g_GlobalVars->curtime) { - lastcmd = g_GlobalVars->curtime; + if (lastcmd > g_GlobalVars->absoluteframetime) { + lastcmd = g_GlobalVars->absoluteframetime; } if (airstuck.KeyDown() && !g_Settings.bInvalid) { if (CE_GOOD(LOCAL_E)) { - if (lastcmd + sv_player_usercommand_timeout->GetFloat() - 0.05f < g_GlobalVars->curtime) { + if (lastcmd + sv_player_usercommand_timeout->GetFloat() - 0.1f < g_GlobalVars->curtime) { if (msg.GetType() == clc_Move) return false; } else { - lastcmd = g_GlobalVars->curtime; + lastcmd = g_GlobalVars->absoluteframetime; } } }