fix chams crash
This commit is contained in:
parent
2bc7606b56
commit
674e77e78f
@ -85,10 +85,10 @@ void EffectChams::EndRenderChams()
|
|||||||
CMatRenderContextPtr ptr(GET_RENDER_CONTEXT);
|
CMatRenderContextPtr ptr(GET_RENDER_CONTEXT);
|
||||||
g_IVModelRender->ForcedMaterialOverride(nullptr);
|
g_IVModelRender->ForcedMaterialOverride(nullptr);
|
||||||
}
|
}
|
||||||
static rgba_t data[32] = { colors::empty };
|
static rgba_t data[33] = { colors::empty };
|
||||||
void EffectChams::SetEntityColor(CachedEntity *ent, rgba_t color)
|
void EffectChams::SetEntityColor(CachedEntity *ent, rgba_t color)
|
||||||
{
|
{
|
||||||
if (ent->m_IDX > 31 || ent->m_IDX < 0)
|
if (ent->m_IDX > 32 || ent->m_IDX < 0)
|
||||||
return;
|
return;
|
||||||
data[ent->m_IDX] = color;
|
data[ent->m_IDX] = color;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ rgba_t EffectChams::ChamsColor(IClientEntity *entity)
|
|||||||
{
|
{
|
||||||
if (!isHackActive() || !*effect_chams::enable)
|
if (!isHackActive() || !*effect_chams::enable)
|
||||||
return colors::empty;
|
return colors::empty;
|
||||||
;
|
|
||||||
CachedEntity *ent = ENTITY(entity->entindex());
|
CachedEntity *ent = ENTITY(entity->entindex());
|
||||||
if (disco_chams)
|
if (disco_chams)
|
||||||
{
|
{
|
||||||
@ -157,12 +157,15 @@ rgba_t EffectChams::ChamsColor(IClientEntity *entity)
|
|||||||
}
|
}
|
||||||
return disco;
|
return disco;
|
||||||
}
|
}
|
||||||
|
if (ent->m_IDX <= 32 && ent->m_IDX >= 0)
|
||||||
|
{
|
||||||
if (data[entity->entindex()] != colors::empty)
|
if (data[entity->entindex()] != colors::empty)
|
||||||
{
|
{
|
||||||
auto toret = data[entity->entindex()];
|
auto toret = data[entity->entindex()];
|
||||||
data[entity->entindex()] = colors::empty;
|
data[entity->entindex()] = colors::empty;
|
||||||
return toret;
|
return toret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (CE_BAD(ent))
|
if (CE_BAD(ent))
|
||||||
return colors::white;
|
return colors::white;
|
||||||
if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(entity))
|
if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(entity))
|
||||||
|
Reference in New Issue
Block a user