From 1afc5d7988c5695a0f823c0f4403d56b82591c76 Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Sun, 12 May 2019 09:46:40 +0200 Subject: [PATCH] Fix #33 --- src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java | 6 ++---- src/com/massivecraft/factions/cmd/CmdFactionsKick.java | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java index 5a846bb4..2845009a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagSet.java @@ -41,8 +41,7 @@ public class CmdFactionsFlagSet extends FactionsCommand // Is this flag editable? if (!msender.isOverriding() && ! flag.isEditable()) { - msg("The flag %s is not editable.", flag.getName()); - return; + throw new MassiveException().addMsg("The flag %s is not editable.", flag.getName()); } // Event @@ -54,8 +53,7 @@ public class CmdFactionsFlagSet extends FactionsCommand // No change if (faction.getFlag(flag) == value) { - msg("%s already has %s set to %s.", faction.describeTo(msender), flag.getStateDesc(value, false, true, true, false, true), flag.getStateDesc(value, true, true, false, false, false)); - return; + throw new MassiveException().addMsg("%s already has %s set to %s.", faction.describeTo(msender), flag.getStateDesc(value, false, true, true, false, true), flag.getStateDesc(value, true, true, false, false, false)); } // Apply diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java index d404f00e..3d2e7379 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -43,22 +43,22 @@ public class CmdFactionsKick extends FactionsCommand return; } - if (mplayer.getRank().isLeader() && !msender.isOverriding()) + if ( !msender.isOverriding() && mplayer.getRank().isLeader()) { throw new MassiveException().addMsg("The leader cannot be kicked."); } - if (mplayer.getRank().isMoreThan(msender.getRank()) && ! msender.isOverriding()) + if (! msender.isOverriding() && mplayer.getFaction() == msenderFaction && mplayer.getRank().isMoreThan(msender.getRank()) ) { throw new MassiveException().addMsg("You can't kick people of higher rank than yourself."); } - if (mplayer.getRank() == msender.getRank() && ! msender.isOverriding()) + if (! msender.isOverriding() && mplayer.getRank() == msender.getRank()) { throw new MassiveException().addMsg("You can't kick people of the same rank as yourself."); } - if ( ! MConf.get().canLeaveWithNegativePower && mplayer.getPower() < 0 && ! msender.isOverriding()) + if ( ! msender.isOverriding() && ! MConf.get().canLeaveWithNegativePower && mplayer.getPower() < 0) { msg("You can't kick that person until their power is positive."); return;