(Re-)added ammo packs to lag exploit
This commit is contained in:
parent
086b4ff8e8
commit
c642600ac3
@ -128,6 +128,42 @@ 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() + 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);
|
||||||
|
// CE_BAD is used to prevent removeconding on empty spaces where the item hasn't respawned
|
||||||
|
// Class check to ensure entity is pickup item
|
||||||
|
if (CE_BAD(e) || e->m_iClassID != CL_CLASS(CBaseAnimating)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bounds check
|
||||||
|
const Vector& max2 = c->OBBMaxs() + e->m_vecOrigin + Vector(8, 8, 8);
|
||||||
|
const Vector& min2 = c->OBBMins() + e->m_vecOrigin - Vector(8, 8, 8);
|
||||||
|
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);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// More paste from kathook
|
// More paste from kathook
|
||||||
if (g_pUserCmd->buttons & (IN_ATTACK | IN_ATTACK2)) {
|
if (g_pUserCmd->buttons & (IN_ATTACK | IN_ATTACK2)) {
|
||||||
@ -148,29 +184,6 @@ 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) {
|
|
||||||
ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable();
|
|
||||||
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;
|
|
||||||
ICollideable* c = RAW_ENT(e)->GetCollideable();
|
|
||||||
const Vector& max2 = c->OBBMaxs() + e->m_vecOrigin + Vector(8, 8, 8);
|
|
||||||
const Vector& min2 = c->OBBMins() + e->m_vecOrigin - Vector(8, 8, 8);
|
|
||||||
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;
|
if (!amount) return;
|
||||||
// Modifying command_number and lastoutgoingcommand turned out to be useless
|
// Modifying command_number and lastoutgoingcommand turned out to be useless
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user