Fixed boss text appearing when all players become invalid

This commit is contained in:
Ben 2015-02-09 00:32:22 +00:00
parent 99f8ccf38e
commit 40034ab490

View file

@ -998,13 +998,14 @@ function GM:CalculateNextBoss()
end end
table.sort(zombies, BossZombieSort) table.sort(zombies, BossZombieSort)
local newboss = zombies[1] local newboss = zombies[1]
if newboss and newboss:IsValid() then local newbossclass = ""
local newbossclass = GAMEMODE.ZombieClasses[newboss:GetBossZombieIndex()].Name
net.Start("zs_nextboss") if newboss and newboss:IsValid() then newbossclass = GAMEMODE.ZombieClasses[newboss:GetBossZombieIndex()].Name end
net.WriteEntity(newboss) net.Start("zs_nextboss")
net.WriteString(newbossclass) net.WriteEntity(newboss)
net.Broadcast() net.WriteString(newbossclass)
end net.Broadcast()
return newboss return newboss
end end