Check if pEntity is null before showing trigger

This commit is contained in:
Kamay Xutax 2024-09-05 21:51:19 +02:00
parent 3803f18be4
commit 4878bce085

View file

@ -21,6 +21,11 @@ CON_COMMAND(report_triggerinfo, "")
{ {
C_BaseEntity* pEntity = (C_BaseEntity*) cl_entitylist->GetClientEntity( i ); C_BaseEntity* pEntity = (C_BaseEntity*) cl_entitylist->GetClientEntity( i );
if ( !pEntity )
{
continue;
}
if (!IsTriggerClass(pEntity)) if (!IsTriggerClass(pEntity))
{ {
continue; continue;
@ -50,7 +55,7 @@ void Cmd_ShowtriggersToggle_f( const CCommand &args )
{ {
C_BaseEntity* pEntity = (C_BaseEntity*) cl_entitylist->GetClientEntity( i ); C_BaseEntity* pEntity = (C_BaseEntity*) cl_entitylist->GetClientEntity( i );
if ( IsTriggerClass(pEntity) ) if ( pEntity && IsTriggerClass(pEntity) )
{ {
if ( pEntity->IsEffectActive( EF_NODRAW ) ) if ( pEntity->IsEffectActive( EF_NODRAW ) )
{ {