VisCheck actually does things.

This commit is contained in:
nullifiedcat 2017-01-17 22:20:05 +03:00
parent 99c1e7a998
commit 9242ec81fd
2 changed files with 6 additions and 3 deletions

View File

@ -208,6 +208,7 @@ Color colors::EntityF(CachedEntity* ent) {
result = RainbowCurrent(); break; result = RainbowCurrent(); break;
} }
} }
if (g_phESP->v_bVisCheck->GetBool())
if (!ent->IsVisible()) result = Transparent(result); if (!ent->IsVisible()) result = Transparent(result);
} }

View File

@ -35,7 +35,7 @@ void EntityHitboxCache::InvalidateCache() {
void EntityHitboxCache::Update() { void EntityHitboxCache::Update() {
SAFE_CALL(InvalidateCache()); SAFE_CALL(InvalidateCache());
if (CE_BAD(m_pParentEntity)) return; if (CE_BAD(m_pParentEntity)) return;
model_t* model; model_t* model = 0;
SAFE_CALL(model = (model_t*)RAW_ENT(m_pParentEntity)->GetModel()); SAFE_CALL(model = (model_t*)RAW_ENT(m_pParentEntity)->GetModel());
if (!model) return; if (!model) return;
if (!m_bModelSet || model != m_pLastModel) { if (!m_bModelSet || model != m_pLastModel) {
@ -46,7 +46,9 @@ void EntityHitboxCache::Update() {
m_pLastModel = model; m_pLastModel = model;
m_pHitboxSet = set; m_pHitboxSet = set;
m_nNumHitboxes = 0; m_nNumHitboxes = 0;
if (set) {
SAFE_CALL(m_nNumHitboxes = set->numhitboxes); SAFE_CALL(m_nNumHitboxes = set->numhitboxes);
}
if (m_nNumHitboxes > CACHE_MAX_HITBOXES) m_nNumHitboxes = CACHE_MAX_HITBOXES; if (m_nNumHitboxes > CACHE_MAX_HITBOXES) m_nNumHitboxes = CACHE_MAX_HITBOXES;
m_bSuccess = true; m_bSuccess = true;
m_bModelSet = true; m_bModelSet = true;