Make zombie survival work with other non-zombie map players.

This commit is contained in:
UnknownShadow200 2016-03-28 12:34:30 +11:00
parent b4bb5d098a
commit ac6fd1afd8
2 changed files with 9 additions and 1 deletions

View File

@ -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);
}

View File

@ -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) {