diff --git a/MCGalaxy/Commands/Moderation/CmdTempRank.cs b/MCGalaxy/Commands/Moderation/CmdTempRank.cs index 30b195d20..e875e1ec0 100644 --- a/MCGalaxy/Commands/Moderation/CmdTempRank.cs +++ b/MCGalaxy/Commands/Moderation/CmdTempRank.cs @@ -90,11 +90,7 @@ namespace MCGalaxy.Commands.Moderation { Group curRank = who != null ? who.group : Group.findPlayerGroup(target); Group oldRank = Group.Find(parts[4 - 1]); // -1 because data, not whole line - // Old rank was deleted, can't revert rank - if (oldRank == null) { - Server.tempRanks.Remove(target); - return; - } + if (oldRank == null) return; string reason = "temp rank unassigned"; if (!CmdSetRank.CanChangeRank(target, curRank, oldRank, who, p, ref reason)) return; diff --git a/MCGalaxy/Server/Tasks/ServerTasks.cs b/MCGalaxy/Server/Tasks/ServerTasks.cs index c090c8463..8b003f9ef 100644 --- a/MCGalaxy/Server/Tasks/ServerTasks.cs +++ b/MCGalaxy/Server/Tasks/ServerTasks.cs @@ -184,7 +184,10 @@ namespace MCGalaxy.Tasks { if (DateTime.UtcNow >= expiry.FromUnixTime()) { Command.all.Find("temprank").Use(null, args[0] + " delete"); - Server.tempRanks.Remove(args[0]); // handle case of temp rank being same as current rank + // Handle case of old rank no longer existing + if (Server.tempRanks.Remove(args[0])) { + Server.tempRanks.Save(); + } } } task.Delay = TemprankNextRun();