From 4c8adff107c994b7afba1c00ff0827a401942469 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 21 Jul 2017 20:20:54 +0300 Subject: [PATCH] Working Infinite Healthpacks, close #209 --- src/hacks/LagExploit.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 09d4409e..e5609064 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -148,26 +148,25 @@ void CreateMove() { } // 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) { + 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(); + const Vector& max1 = p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); + const Vector& min1 = p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); for (int i = 1; i < entity_cache::max; i++) { CachedEntity* e = ENTITY(i); + if (CE_BAD(e)) continue; 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(); + ICollideable* c = RAW_ENT(e)->GetCollideable(); + const Vector& max2 = c->OBBMaxs() + e->m_vecOrigin;// + Vector(10, 10, 10); + const Vector& min2 = c->OBBMins() + e->m_vecOrigin;// - Vector(10, 10, 10); 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); + //logging::Info("Collision with %d", i); amount = 900; break; - }*/ + } } }