Fix your own tab list entry not being updated after unhiding. (Thanks KawaiiCube)

This commit is contained in:
UnknownShadow200 2016-09-17 07:44:57 +10:00
parent 1679c25a1f
commit 2480349443
2 changed files with 3 additions and 9 deletions

View File

@ -282,13 +282,6 @@ namespace MCGalaxy.Commands {
}
}
static void EnsureFileExists(string path) {
if (!Directory.Exists("levels/blacklists/"))
Directory.CreateDirectory("levels/blacklists/");
if (!File.Exists(path))
File.Create(path).Dispose();
}
static string NextLevel(Player p) {
string level = p.name.ToLower();
if (LevelInfo.ExistsOffline(level) || LevelInfo.ExistsOffline(level + "00")) {

View File

@ -58,9 +58,9 @@ namespace MCGalaxy.Commands {
if (p.hidden) {
Entities.GlobalDespawn(p, false);
TabList.Add(p, p, 0xFF);
if (messageOps && !p.otherRankHidden)
Chat.MessageOps("To Ops -" + p.ColoredName + "%S- is now &finvisible%S.");
string discMsg = PlayerDB.GetLogoutMessage(p);
Player.SendChatFrom(p, "&c- " + p.FullName + " %S" + discMsg, false);
Server.IRC.Say(p.DisplayName + " %Sleft the game (" + discMsg + "%S)");
@ -68,7 +68,6 @@ namespace MCGalaxy.Commands {
Server.hidden.AddOrReplace(p.name);
} else {
Entities.GlobalSpawn(p, false);
p.hidden = false;
p.otherRankHidden = false;
p.oHideRank = LevelPermission.Null;
if (messageOps)
@ -80,6 +79,8 @@ namespace MCGalaxy.Commands {
if (p.adminchat) adminchat.Use(p, message);
Server.hidden.Remove(p.name);
}
TabList.Add(p, p, 0xFF);
Server.hidden.Save(false);
}