Fix CPE messages not being reset for zombie survival, fixes #124.

This commit is contained in:
UnknownShadow200 2016-04-07 12:13:50 +10:00
parent 16a3341282
commit dfd65bbd77
4 changed files with 34 additions and 21 deletions

View File

@ -56,7 +56,7 @@ namespace MCGalaxy {
if (i >= red && i <= white)
Properties[i].KilledByLava = true;
if (i == air || i == shrub || (i >= yellowflower && i <= redmushroom) {
if (i == air || i == shrub || (i >= yellowflower && i <= redmushroom)) {
Properties[i].KilledByLava = true;
Properties[i].KilledByWater = true;
}

View File

@ -23,7 +23,7 @@ namespace MCGalaxy
{
public static bool Walkthrough(byte type) {
return type == air || type == shrub || (type >= water && type <= lavastill)
&& (type >= yelllowflower && type <= redmushroom);
&& (type >= yellowflower && type <= redmushroom);
}
public static bool AllowBreak(byte type)
@ -85,7 +85,7 @@ namespace MCGalaxy
}
public static bool Placable(byte type) {
return !(type == blackrock || (type >= water && type <= lavstill)
return !(type == blackrock || (type >= water && type <= lavastill))
&& type < Block.CpeCount;
}

View File

@ -152,15 +152,21 @@ namespace MCGalaxy.Games {
return;
}
p.SendCpeMessage(CpeMessageType.Status1, "");
p.SendCpeMessage(CpeMessageType.Status2, "");
p.SendCpeMessage(CpeMessageType.Status3, "");
ResetCpeMessages(p);
Alive.Remove(p);
Infected.Remove(p);
if (oldLvl != null && oldLvl.name.CaselessEq(CurLevelName))
UpdateAllPlayerStatus();
}
void ResetCpeMessages(Player p) {
p.SendCpeMessage(CpeMessageType.Status1, "");
p.SendCpeMessage(CpeMessageType.Status2, "");
p.SendCpeMessage(CpeMessageType.Status3, "");
p.SendCpeMessage(CpeMessageType.BottomRight1, "");
p.SendCpeMessage(CpeMessageType.BottomRight2, "");
}
public override bool PlayerCanJoinLevel(Player p, Level lvl, Level oldLvl) {
if (!oldLvl.name.CaselessEq(CurLevelName)) return true;
if (lvl.name.CaselessEq(CurLevelName)) return true;

View File

@ -203,11 +203,18 @@ namespace MCGalaxy.Games {
RoundInProgress = false;
RoundStart = DateTime.MinValue;
RoundEnd = DateTime.MinValue;
Player[] online = PlayerInfo.Online.Items;
foreach (Player pl in online) {
pl.Game.RatedMap = false;
pl.Game.PledgeSurvive = false;
if (pl.level == null || !pl.level.name.CaselessEq(CurLevelName))
continue;
ResetCpeMessages(pl);
}
LastLevelName = "";
CurLevelName = "";
CurLevel = null;
Player[] online = PlayerInfo.Online.Items;
foreach (Player pl in online) {
pl.Game.RatedMap = false;
pl.Game.PledgeSurvive = false;