Fix perms in promote

This commit is contained in:
Trent Hensler 2018-03-21 00:15:20 -07:00
parent db8bece127
commit 2675ae1760
2 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,13 @@ public class FPromoteCommand extends FCommand {
Role current = target.getRole(); Role current = target.getRole();
Role promotion = Role.getRelative(current, +relative); Role promotion = Role.getRelative(current, +relative);
// Don't allow people to control people that are below them.
if (current.value >= fme.getRole().value) {
fme.msg(TL.COMMAND_PROMOTE_NOT_ALLOWED);
return;
}
if (promotion == null) { if (promotion == null) {
fme.msg(TL.COMMAND_PROMOTE_NOTTHATPLAYER); fme.msg(TL.COMMAND_PROMOTE_NOTTHATPLAYER);
return; return;

View File

@ -429,6 +429,7 @@ public enum TL {
COMMAND_PROMOTE_WRONGFACTION("%1$s is not part of your faction."), COMMAND_PROMOTE_WRONGFACTION("%1$s is not part of your faction."),
COMMAND_NOACCESS("You don't have access to that."), COMMAND_NOACCESS("You don't have access to that."),
COMMAND_PROMOTE_NOTTHATPLAYER("That player cannot be promoted."), COMMAND_PROMOTE_NOTTHATPLAYER("That player cannot be promoted."),
COMMAND_PROMOTE_NOT_ALLOWED("You can't promote or demote that player."),
COMMAND_POWER_TOSHOW("to show player power info"), COMMAND_POWER_TOSHOW("to show player power info"),
COMMAND_POWER_FORSHOW("for showing player power info"), COMMAND_POWER_FORSHOW("for showing player power info"),