Working Infinite Healthpacks, close #209

This commit is contained in:
nullifiedcat 2017-07-21 20:20:54 +03:00
parent 4c3662aad5
commit 4c8adff107

View File

@ -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;
}*/
}
}
}