From 2675ae176069c27458c73ef29c15968ab935872d Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Wed, 21 Mar 2018 00:15:20 -0700 Subject: [PATCH] Fix perms in promote --- .../com/massivecraft/factions/cmd/FPromoteCommand.java | 7 +++++++ src/main/java/com/massivecraft/factions/zcore/util/TL.java | 1 + 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/massivecraft/factions/cmd/FPromoteCommand.java b/src/main/java/com/massivecraft/factions/cmd/FPromoteCommand.java index 590767f5..04c3a76d 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FPromoteCommand.java +++ b/src/main/java/com/massivecraft/factions/cmd/FPromoteCommand.java @@ -52,6 +52,13 @@ public class FPromoteCommand extends FCommand { Role current = target.getRole(); 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) { fme.msg(TL.COMMAND_PROMOTE_NOTTHATPLAYER); return; diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index 82182531..1d16a6a5 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -429,6 +429,7 @@ public enum TL { COMMAND_PROMOTE_WRONGFACTION("%1$s is not part of your faction."), COMMAND_NOACCESS("You don't have access to that."), 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_FORSHOW("for showing player power info"),