From ac6fd1afd82b8b9730d1711ad5db1bc9535989b6 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 28 Mar 2016 12:34:30 +1100 Subject: [PATCH] Make zombie survival work with other non-zombie map players. --- Games/ZombieSurvival/ZombieGame.Core.cs | 1 + Games/ZombieSurvival/ZombieGame.Game.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Games/ZombieSurvival/ZombieGame.Core.cs b/Games/ZombieSurvival/ZombieGame.Core.cs index 655472b0d..66531e943 100644 --- a/Games/ZombieSurvival/ZombieGame.Core.cs +++ b/Games/ZombieSurvival/ZombieGame.Core.cs @@ -83,6 +83,7 @@ namespace MCGalaxy.Games { Player[] online = PlayerInfo.Online.Items; foreach (Player p in online) { + if (p.level == null || p.level != CurLevel) continue; if (p != first) Alive.Add(p); } diff --git a/Games/ZombieSurvival/ZombieGame.Game.cs b/Games/ZombieSurvival/ZombieGame.Game.cs index 63457d146..663a9aa1b 100644 --- a/Games/ZombieSurvival/ZombieGame.Game.cs +++ b/Games/ZombieSurvival/ZombieGame.Game.cs @@ -162,7 +162,14 @@ namespace MCGalaxy.Games { } public override bool PlayerCanJoinLevel(Player p, Level lvl, Level oldLvl) { - return base.PlayerCanJoinLevel(p, lvl, oldLvl); + if (!oldLvl.name.CaselessEq(CurLevelName)) return true; + if (lvl.name.CaselessEq(CurLevelName)) return true; + + if (RoundInProgress && !p.referee) { + p.SendMessage("Sorry, you cannot leave a zombie survival map until the current round has ended."); + return false; + } + return true; } public override void PlayerMoneyChanged(Player p) {