Add IsFree check to FindEntityByNetClass in SDKTools (PR #330).

This commit is contained in:
Yed 2015-05-04 18:13:11 -07:00 committed by Kyle Sanderson
parent ffedae66f4
commit 5694a759ce

View File

@ -46,7 +46,7 @@ static CBaseEntity *FindEntityByNetClass(int start, const char *classname)
for (int i = start; i < maxEntities; i++) for (int i = start; i < maxEntities; i++)
{ {
edict_t *current = gamehelpers->EdictOfIndex(i); edict_t *current = gamehelpers->EdictOfIndex(i);
if (current == NULL) if (current == NULL || current->IsFree())
continue; continue;
IServerNetworkable *network = current->GetNetworkable(); IServerNetworkable *network = current->GetNetworkable();