Fixed boss text appearing when all players become invalid
This commit is contained in:
parent
99f8ccf38e
commit
40034ab490
1 changed files with 8 additions and 7 deletions
|
@ -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
|
|
||||||
|
if newboss and newboss:IsValid() then newbossclass = GAMEMODE.ZombieClasses[newboss:GetBossZombieIndex()].Name end
|
||||||
net.Start("zs_nextboss")
|
net.Start("zs_nextboss")
|
||||||
net.WriteEntity(newboss)
|
net.WriteEntity(newboss)
|
||||||
net.WriteString(newbossclass)
|
net.WriteString(newbossclass)
|
||||||
net.Broadcast()
|
net.Broadcast()
|
||||||
end
|
|
||||||
return newboss
|
return newboss
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue