Fix color not reverting at TNT wars end, fix CTF/TNT wars initial tab list entry being wrong

This commit is contained in:
UnknownShadow200 2018-07-09 20:48:11 +10:00
parent 8ebfc9a487
commit d54fca0f33
3 changed files with 16 additions and 13 deletions

View File

@ -76,7 +76,7 @@ namespace MCGalaxy.SQL {
internal static object Do(string sql, bool createDB, object arg,
ReaderCallback callback, params object[] args) {
Exception e = null;
Exception e = null;
for (int i = 0; i < 10; i++) {
try {
if (callback != null) {

View File

@ -51,18 +51,19 @@ namespace MCGalaxy.Games {
Chat.MessageGlobal("A game of {0} is starting on {1}%S!", GameName, Map.ColoredName);
Logger.Log(LogType.GameActivity, "[{0}] Game started", GameName);
StartGame();
StartGame();
RoundsLeft = rounds;
Running = true;
IGame.RunningGames.Add(this);
OnStateChangedEvent.Call(this);
HookEventHandlers();
Player[] players = PlayerInfo.Online.Items;
foreach (Player pl in players) {
if (pl.level == Map) PlayerJoinedGame(pl);
}
RoundsLeft = rounds;
Running = true;
IGame.RunningGames.Add(this);
OnStateChangedEvent.Call(this);
HookEventHandlers();
Thread t = new Thread(RunGame);
t.Name = "MCG_" + GameName;
t.Start();

View File

@ -154,6 +154,11 @@ namespace MCGalaxy.Games {
Red.Members.Clear();
Blue.Score = 0;
Red.Score = 0;
Player[] players = allPlayers.Items;
foreach (Player pl in players) {
RestoreColor(pl);
}
}
public override void PlayerJoinedGame(Player p) {
@ -184,6 +189,8 @@ namespace MCGalaxy.Games {
Map.Message(p.ColoredName + " %Sjoined the " + team.ColoredName + " %Steam");
p.color = team.Color;
p.SetPrefix();
Player.Message(p, "You are now on the " + team.ColoredName + " team!");
TabList.Update(p, true);
}
@ -217,11 +224,6 @@ namespace MCGalaxy.Games {
MessageMap(CpeMessageType.Announcement,
"&4Gamemode changed to &fFree For All");
ResetTeams();
Player[] players = allPlayers.Items;
foreach (Player pl in players) {
RestoreColor(pl);
}
Config.Save();
}