From 40034ab4904a96d558d14f816661d860aeb91883 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 9 Feb 2015 00:32:22 +0000 Subject: [PATCH] Fixed boss text appearing when all players become invalid --- gamemodes/zombiesurvival/gamemode/init.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/init.lua b/gamemodes/zombiesurvival/gamemode/init.lua index f6f3ec0..4ad2907 100644 --- a/gamemodes/zombiesurvival/gamemode/init.lua +++ b/gamemodes/zombiesurvival/gamemode/init.lua @@ -998,13 +998,14 @@ function GM:CalculateNextBoss() end table.sort(zombies, BossZombieSort) local newboss = zombies[1] - if newboss and newboss:IsValid() then - local newbossclass = GAMEMODE.ZombieClasses[newboss:GetBossZombieIndex()].Name - net.Start("zs_nextboss") - net.WriteEntity(newboss) - net.WriteString(newbossclass) - net.Broadcast() - end + local newbossclass = "" + + if newboss and newboss:IsValid() then newbossclass = GAMEMODE.ZombieClasses[newboss:GetBossZombieIndex()].Name end + net.Start("zs_nextboss") + net.WriteEntity(newboss) + net.WriteString(newbossclass) + net.Broadcast() + return newboss end