From 4f54a3462927db80b83376d07b3afdd723ddd544 Mon Sep 17 00:00:00 2001 From: Retarded-Skid Date: Thu, 13 Jul 2017 20:53:30 -0400 Subject: [PATCH] Updated removecond for pickups to use AddExploitTicks like the other options --- src/hacks/LagExploit.cpp | 72 +++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 7428252d..a429ac39 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -128,6 +128,43 @@ void CreateMove() { } } } + + // Infinite pickups (health and ammo) + if (infinite_packs && CE_GOOD(LOCAL_E)) { + 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); + // CE_BAD is used to prevent removeconding on empty spaces where the item hasn't respawned + // Distance check so removecond activates before collision with the pickup + if (CE_BAD(e) || e->m_iClassID != CL_CLASS(CBaseAnimating) || e->m_flDistance > 66.0f) { + continue; + } + // Lag for health + if (LOCAL_E->m_iHealth < LOCAL_E->m_iMaxHealth && (e->m_ItemType == ITEM_HEALTH_SMALL || e->m_ItemType == ITEM_HEALTH_MEDIUM || e->m_ItemType == ITEM_HEALTH_LARGE) ) { + AddExploitTicks(3); + } + // Lag for ammo / metal + // TODO: Alternative to - LOCAL_E->m_iAmmo < LOCAL_E->m_iMaxAmmo + // That is pseudocode but checking each weapon for ammo + engie for metal would be ideal + if ((e->m_ItemType == ITEM_AMMO_SMALL || e->m_ItemType == ITEM_AMMO_MEDIUM || e->m_ItemType == ITEM_AMMO_LARGE) ) { + AddExploitTicks(3); + } + + // 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; + }*/ + } + } } // More paste from kathook if (g_pUserCmd->buttons & (IN_ATTACK | IN_ATTACK2)) { @@ -147,41 +184,6 @@ void CreateMove() { amount = int(mini_lag_exploit); } - // Infinite pickups (I'll probably have to move this somewhere else) - if (infinite_packs && CE_GOOD(LOCAL_E)) { - 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 (CE_BAD(e)) continue; - if (e->m_iClassID != CL_CLASS(CBaseAnimating)) continue; - if (e->m_flDistance > 54.0f) continue; - if (e->m_ItemType == ITEM_NONE) continue; - // Lag for health - if (LOCAL_E->m_iHealth < LOCAL_E->m_iMaxHealth) { - if (e->m_ItemType == ITEM_HEALTH_SMALL || e->m_ItemType == ITEM_HEALTH_MEDIUM || e->m_ItemType == ITEM_HEALTH_LARGE) amount = lagValue; - } - // Lag for ammo / metal - // TODO: Figure out way to properly check for not having max-ammo - // - // if (LOCAL_E->m_iAmmo < LOCAL_E->m_iMaxAmmo) { - if (e->m_ItemType == ITEM_AMMO_SMALL || e->m_ItemType == ITEM_AMMO_MEDIUM || e->m_ItemType == ITEM_AMMO_LARGE) amount = lagValue; - - - // 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