Fix a sightlines crash

This commit is contained in:
BenCat07 2021-06-23 19:40:04 +02:00 committed by LightCat
parent cb5f6d4090
commit a192ff1bea

View File

@ -480,7 +480,7 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
if (sightlines && type == ENTITY_PLAYER) if (sightlines && type == ENTITY_PLAYER)
{ {
// Logic for using the enum to sort out snipers // Logic for using the enum to sort out snipers
if ((int) sightlines == 2 || ((int) sightlines == 1 && CE_INT(ent, netvar.iClass) == tf_sniper)) if (((int) sightlines == 2 || ((int) sightlines == 1 && CE_INT(ent, netvar.iClass) == tf_sniper)) && CE_GOOD(ent) && ent->hitboxes.GetHitbox(0))
{ {
PROF_SECTION(PT_esp_sightlines); PROF_SECTION(PT_esp_sightlines);
@ -1849,12 +1849,14 @@ void SetEntityColor(CachedEntity *entity, const rgba_t &color)
data[entity->m_IDX].color = color; data[entity->m_IDX].color = color;
} }
static InitRoutine init([]() { static InitRoutine init(
[]()
{
EC::Register(EC::CreateMove, cm, "cm_esp", EC::average); EC::Register(EC::CreateMove, cm, "cm_esp", EC::average);
#if ENABLE_VISUALS #if ENABLE_VISUALS
EC::Register(EC::Draw, Draw, "draw_esp", EC::average); EC::Register(EC::Draw, Draw, "draw_esp", EC::average);
Init(); Init();
#endif #endif
}); });
} // namespace hacks::shared::esp } // namespace hacks::shared::esp