Resolves kicking of a higher ranked Member

This commit is contained in:
ulumulu1510 2015-02-25 20:36:47 +01:00 committed by Olof Larsson
parent aa4645b036
commit c65da10b52

View File

@ -46,7 +46,7 @@ public class CmdFactionsKick extends FactionsCommand
// Validate // Validate
if (msender == mplayer) if (msender == mplayer)
{ {
msg("<b>You cannot kick yourself."); msg("<b>You can't kick yourself.");
msg("<i>You might want to: %s", Factions.get().getOuterCmdFactions().cmdFactionsLeave.getUseageTemplate(false)); msg("<i>You might want to: %s", Factions.get().getOuterCmdFactions().cmdFactionsLeave.getUseageTemplate(false));
return; return;
} }
@ -56,10 +56,16 @@ public class CmdFactionsKick extends FactionsCommand
msg("<b>The leader can not be kicked."); msg("<b>The leader can not be kicked.");
return; return;
} }
if (mplayer.getRole().compareTo(msender.getRole()) < 0 && !(this.senderIsConsole || msender.isUsingAdminMode()))
{
msg("<b>You can't kick people of higher rank than yourself.");
return;
}
if ( ! MConf.get().canLeaveWithNegativePower && mplayer.getPower() < 0 && ! msender.isUsingAdminMode()) if ( ! MConf.get().canLeaveWithNegativePower && mplayer.getPower() < 0 && ! msender.isUsingAdminMode())
{ {
msg("<b>You cannot kick that member until their power is positive."); msg("<b>You can't kick that person until their power is positive.");
return; return;
} }