mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
don't forget to save tempranks list
This commit is contained in:
parent
4b08765c49
commit
3d9f40d94e
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user