Fixed internal error caused by trying to demote a player who already has the lowest rank

This commit is contained in:
Stefan923
2020-05-09 14:53:02 +03:00
committed by BrowkS
parent 842eb097c6
commit 31b8f0be25
2 changed files with 7 additions and 1 deletions

View File

@@ -57,6 +57,11 @@ public class FPromoteCommand extends FCommand {
context.msg(TL.COMMAND_PROMOTE_NOT_SAME);
return;
}
// Don't allow people to demote people who already have the lowest rank.
if (current.value == 0 && relative <= 0) {
context.msg(TL.COMMAND_PROMOTE_LOWEST_RANK, target.getName());
return;
}
// Don't allow people to promote people to their same or higher rank.
if (context.fPlayer.getRole().value <= promotion.value) {
context.msg(TL.COMMAND_PROMOTE_NOT_ALLOWED);