Fixed Alts NullPointer

Setup base for Members Upgrade
This commit is contained in:
Driftay
2019-05-19 19:01:59 -04:00
parent 06e7eaf572
commit 3c5d8ee050
4 changed files with 14 additions and 1 deletions

View File

@@ -75,14 +75,23 @@ public class CmdJoin extends FCommand {
}
return;
}
int limit = 0;
int altLimit = Conf.factionAltMemberLimit;
limit = Conf.factionMemberLimit;
if (limit > 0 && faction.getFPlayers().size() >= limit && !faction.altInvited(fme)) {
msg(TL.COMMAND_JOIN_ATLIMIT, faction.getTag(fme), limit, fplayer.describeTo(fme, false));
return;
}
if (altLimit > 0 && faction.getAltPlayers().size() >= altLimit && !faction.altInvited(fme)) {
msg(TL.COMMAND_JOIN_ATLIMIT, faction.getTag(fme), altLimit, fplayer.describeTo(fme, false));
return;
}
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
if (samePlayer && !canAffordCommand(Conf.econCostJoin, TL.COMMAND_JOIN_TOJOIN.toString())) {
return;