Fix Lua error involving GetProp

Addresses https://github.com/JetBoom/zombiesurvival/issues/91
This commit is contained in:
JetBoom 2015-01-01 18:48:31 -05:00
parent 63849dcaa4
commit 81820d6e8b

View file

@ -17,7 +17,7 @@ function ENT:SetProp(ent)
if not IsValid(ent) then return end if not IsValid(ent) then return end
for _, e in pairs(ents.FindByClass(self:GetClass())) do for _, e in pairs(ents.FindByClass(self:GetClass())) do
if e ~= self and e:GetProp() == ent then return end if e ~= self and e and e:IsValid() and e:GetProp() == ent then return end
end end
local teamid = self:GetTeam() local teamid = self:GetTeam()