diff --git a/Games/ZombieSurvival/ZombieGame.Core.cs b/Games/ZombieSurvival/ZombieGame.Core.cs index c59ad1df2..bff8d6fa2 100644 --- a/Games/ZombieSurvival/ZombieGame.Core.cs +++ b/Games/ZombieSurvival/ZombieGame.Core.cs @@ -27,6 +27,21 @@ namespace MCGalaxy.Games { public sealed partial class ZombieGame { void MainLoop() { + // Make sure that in the worst case, we do not crash the entire server. + try { + MainLoopCore(); + } catch (Exception ex) { + Server.ErrorLog(ex); + Player.GlobalMessage("&cZombie survival disabled due to an error."); + try { + ResetState(); + } catch (Exception ex2) { + Server.ErrorLog(ex2); + } + } + } + + void MainLoopCore() { if (Status == ZombieGameStatus.NotStarted) return; if (!initialChangeLevel) { ChooseNextLevel(); diff --git a/Games/ZombieSurvival/ZombieGame.cs b/Games/ZombieSurvival/ZombieGame.cs index fb9d43e91..95a7901d6 100644 --- a/Games/ZombieSurvival/ZombieGame.cs +++ b/Games/ZombieSurvival/ZombieGame.cs @@ -215,10 +215,6 @@ namespace MCGalaxy.Games { LastLevelName = ""; CurLevelName = ""; CurLevel = null; - foreach (Player pl in online) { - pl.Game.RatedMap = false; - pl.Game.PledgeSurvive = false; - } } void UpdatePlayerStatus(Player p) {