Fix join message showing for first round of zombie survival.

This commit is contained in:
UnknownShadow200 2016-09-04 23:30:02 +10:00
parent df0bf301f2
commit 7f6a451530
2 changed files with 8 additions and 2 deletions

View File

@ -116,8 +116,7 @@ namespace MCGalaxy.Commands.World {
CheckGamesJoin(p, oldLevel);
p.prevMsg = "";
bool showJoin = p.level.ShouldSaveChanges() || (oldLevel != null && oldLevel.ShouldSaveChanges());
if (!p.hidden && showJoin) {
if (!p.hidden && p.level.ShouldShowJoinMessage(oldLevel)) {
Player.SendChatFrom(p, p.color + "*" + p.DisplayName + " %Swent to &b" + lvl.name, false);
Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name);
}

View File

@ -127,6 +127,13 @@ namespace MCGalaxy {
return true;
}
public bool ShouldShowJoinMessage(Level prev) {
if (Server.zombie.Running && name.CaselessEq(Server.zombie.CurLevelName)
&& (prev == this || prev.name.CaselessEq(Server.zombie.LastLevelName))) return false;
if (Server.lava.active && Server.lava.HasMap(name)) return false;
return true;
}
/// <summary> The currently active game running on this map,
/// or null if there is no game running. </summary>
public IGame CurrentGame() {