Fix possible IsValid error in PlayerSelectSpawn

Addresses https://github.com/JetBoom/zombiesurvival/issues/97
This commit is contained in:
JetBoom 2015-01-10 00:23:32 -05:00
parent 13125a7ce2
commit 57cbcc0b1e

View file

@ -791,7 +791,7 @@ function GM:PlayerSelectSpawn(pl)
local blocked local blocked
local spawnpos = spawn:GetPos() local spawnpos = spawn:GetPos()
for _, ent in pairs(ents.FindInBox(spawnpos + playermins, spawnpos + playermaxs)) do for _, ent in pairs(ents.FindInBox(spawnpos + playermins, spawnpos + playermaxs)) do
if ent and ent:IsValid() and ent:IsPlayer() and not spawninplayer or string.sub(ent:GetClass(), 1, 5) == "prop_" then if IsValid(ent) and ent:IsPlayer() and not spawninplayer or string.sub(ent:GetClass(), 1, 5) == "prop_" then
blocked = true blocked = true
break break
end end