From 57cbcc0b1e18c037cbcd03cae03da49ca6426121 Mon Sep 17 00:00:00 2001 From: JetBoom Date: Sat, 10 Jan 2015 00:23:32 -0500 Subject: [PATCH] Fix possible IsValid error in PlayerSelectSpawn Addresses https://github.com/JetBoom/zombiesurvival/issues/97 --- gamemodes/zombiesurvival/gamemode/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/zombiesurvival/gamemode/init.lua b/gamemodes/zombiesurvival/gamemode/init.lua index 1098564..8b7d691 100644 --- a/gamemodes/zombiesurvival/gamemode/init.lua +++ b/gamemodes/zombiesurvival/gamemode/init.lua @@ -791,7 +791,7 @@ function GM:PlayerSelectSpawn(pl) local blocked local spawnpos = spawn:GetPos() 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 break end