Skip to content

Commit c940e9f

Browse files
authored
Merge pull request #1010 from ReactiveDrop/findentity_ignore_marked_for_deletion
dont find entities which are marked for deletion
2 parents 4bb0be7 + 41be600 commit c940e9f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/game/server/entitylist.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,9 @@ CBaseEntity *CGlobalEntityList::FindEntityByClassname( CBaseEntity *pStartEntity
599599
continue;
600600
}
601601

602+
if ( pEntity->IsMarkedForDeletion() )
603+
continue;
604+
602605
if ( pEntity->ClassMatches(szName) )
603606
return pEntity;
604607
}
@@ -727,6 +730,9 @@ CBaseEntity *CGlobalEntityList::FindEntityByName( CBaseEntity *pStartEntity, con
727730
continue;
728731
}
729732

733+
if ( ent->IsMarkedForDeletion() )
734+
continue;
735+
730736
if ( !ent->m_iName.Get() )
731737
continue;
732738

@@ -788,6 +794,9 @@ CBaseEntity *CGlobalEntityList::FindEntityByModel( CBaseEntity *pStartEntity, co
788794
continue;
789795
}
790796

797+
if ( ent->IsMarkedForDeletion() )
798+
continue;
799+
791800
if ( !ent->edict() || !ent->GetModelName() )
792801
continue;
793802

@@ -818,6 +827,9 @@ CBaseEntity *CGlobalEntityList::FindEntityByTarget( CBaseEntity *pStartEntity, c
818827
continue;
819828
}
820829

830+
if ( ent->IsMarkedForDeletion() )
831+
continue;
832+
821833
if ( !ent->m_target )
822834
continue;
823835

@@ -890,6 +902,9 @@ CBaseEntity *CGlobalEntityList::FindEntityInSphere( CBaseEntity *pStartEntity, c
890902
continue;
891903
}
892904

905+
if ( ent->IsMarkedForDeletion() )
906+
continue;
907+
893908
if ( !ent->edict() )
894909
continue;
895910

0 commit comments

Comments
 (0)