New option to disallow players from leaving, joining, or being kicked from a faction while they have a negative power level - code by sp1ky, adapted from a pull request

This commit is contained in:
Brettflan
2011-05-29 16:41:50 -05:00
parent b490c5f196
commit 654e3b159b
4 changed files with 18 additions and 0 deletions

View File

@ -42,6 +42,11 @@ public class FCommandJoin extends FBaseCommand {
return;
}
if (!Conf.CanLeaveWithNegativePower && me.getPower() < 0) {
sendMessage("You cannot join a faction until your power is positive.");
return;
}
if( ! faction.getOpen() && ! faction.isInvited(me)) {
sendMessage("This guild requires invitation.");
faction.sendMessage(me.getNameAndRelevant(faction)+Conf.colorSystem+" tried to join your faction.");

View File

@ -46,6 +46,11 @@ public class FCommandKick extends FBaseCommand {
return;
}
if (!Conf.CanLeaveWithNegativePower && you.getPower() < 0) {
sendMessage("You cannot kick that member until their power is positive.");
return;
}
myFaction.deinvite(you);
you.resetFactionData();