fix draw bugs 'n crashes

This commit is contained in:
LightCat 2018-10-21 16:05:42 +02:00
parent 4c76adc9dd
commit 89521493cf
3 changed files with 8 additions and 4 deletions

View File

@ -1592,6 +1592,8 @@ void ResetEntityStrings()
// Sets an entitys esp color
void SetEntityColor(CachedEntity *entity, const rgba_t &color)
{
if (entity->m_IDX > 2047 || entity->m_IDX < 0)
return;
data[entity->m_IDX].color = color;
}
} // namespace hacks::shared::esp

View File

@ -79,13 +79,15 @@ void EffectChams::EndRenderChams()
CMatRenderContextPtr ptr(GET_RENDER_CONTEXT);
g_IVModelRender->ForcedMaterialOverride(nullptr);
}
rgba_t data[32] = {};
static rgba_t data[32] = {};
void EffectChams::SetEntityColor(CachedEntity *ent, rgba_t color)
{
if (ent->m_IDX > 31 || ent->m_IDX < 0)
return;
data[ent->m_IDX] = color;
}
Timer t{};
int prevcolor = -1;
static Timer t{};
static int prevcolor = -1;
rgba_t EffectChams::ChamsColor(IClientEntity *entity)
{
if (!isHackActive() || !*enable)

View File

@ -297,7 +297,7 @@ bool EffectGlow::ShouldRenderGlow(IClientEntity *entity)
{
return *medkits;
}
else if (type >= ITEM_AMMO_SMALL && type <= ITEM_AMMO_SMALL)
else if (type >= ITEM_AMMO_SMALL && type <= ITEM_AMMO_LARGE)
{
return *ammobox;
}