Merge pull request #407 from Thordin/FindEntityByNetClass

Added IsFree() edict check to FindEntityByNetClass
This commit is contained in:
Kyle Sanderson 2015-09-13 14:02:38 -07:00
commit 5b3b17799f

View File

@ -414,7 +414,7 @@ int FindEntityByNetClass(int start, const char *classname)
for (int i = ((start != -1) ? start : 0); i < gpGlobals->maxEntities; i++)
{
current = engine->PEntityOfEntIndex(i);
if (current == NULL)
if (current == NULL || current->IsFree())
{
continue;
}