Working Infinite Healthpacks, close #209
This commit is contained in:
parent
4c3662aad5
commit
4c8adff107
@ -148,26 +148,25 @@ void CreateMove() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Infinite healthpacks (I'll probably have to move this somewhere else)
|
// 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();
|
ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable();
|
||||||
const Vector& max1 = p->OBBMaxs();
|
const Vector& max1 = p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin();
|
||||||
const Vector& min1 = p->OBBMins();
|
const Vector& min1 = p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin();
|
||||||
for (int i = 1; i < entity_cache::max; i++) {
|
for (int i = 1; i < entity_cache::max; i++) {
|
||||||
CachedEntity* e = ENTITY(i);
|
CachedEntity* e = ENTITY(i);
|
||||||
|
if (CE_BAD(e)) continue;
|
||||||
if (e->m_iClassID != CL_CLASS(CBaseAnimating)) 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_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;
|
ICollideable* c = RAW_ENT(e)->GetCollideable();
|
||||||
// Not working for some reason?
|
const Vector& max2 = c->OBBMaxs() + e->m_vecOrigin;// + Vector(10, 10, 10);
|
||||||
/*ICollideable* c = RAW_ENT(e)->GetCollideable();
|
const Vector& min2 = c->OBBMins() + e->m_vecOrigin;// - Vector(10, 10, 10);
|
||||||
const Vector& max2 = c->OBBMaxs();
|
|
||||||
const Vector& min2 = c->OBBMins();
|
|
||||||
if ( (min1.x <= max2.x && max1.x >= min2.x) &&
|
if ( (min1.x <= max2.x && max1.x >= min2.x) &&
|
||||||
(min1.y <= max2.y && max1.y >= min2.y) &&
|
(min1.y <= max2.y && max1.y >= min2.y) &&
|
||||||
(min1.z <= max2.z && max1.z >= min2.z) ) {
|
(min1.z <= max2.z && max1.z >= min2.z) ) {
|
||||||
logging::Info("Collision with %d", i);
|
//logging::Info("Collision with %d", i);
|
||||||
amount = 900;
|
amount = 900;
|
||||||
break;
|
break;
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user