forked from MagicBane/Server
subs limited to cap rank
This commit is contained in:
@@ -75,7 +75,7 @@ public class AcceptSubInviteHandler extends AbstractClientMsgHandler {
|
|||||||
//source guild is limited to 7 subs
|
//source guild is limited to 7 subs
|
||||||
//TODO this should be based on TOL rank
|
//TODO this should be based on TOL rank
|
||||||
|
|
||||||
if (!targetGuild.canSubAGuild(sourceGuild)) {
|
if (!targetGuild.canSubAGuild(sourceGuild,targetGuild)) {
|
||||||
ErrorPopupMsg.sendErrorPopup(sourcePlayer, 45); // Failure to swear guild
|
ErrorPopupMsg.sendErrorPopup(sourcePlayer, 45); // Failure to swear guild
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
|
|||||||
//TODO this should be based on TOL rank
|
//TODO this should be based on TOL rank
|
||||||
|
|
||||||
|
|
||||||
if (!sourceGuild.canSubAGuild(targetGuild)) {
|
if (!sourceGuild.canSubAGuild(targetGuild, null)) {
|
||||||
sendChat(source, "This Guild can't be subbed.");
|
sendChat(source, "This Guild can't be subbed.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -559,17 +559,21 @@ public class Guild extends AbstractWorldObject {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSubAGuild(Guild toSub){
|
public boolean canSubAGuild(Guild toSub, Guild nation){
|
||||||
|
|
||||||
boolean canSub;
|
boolean canSub;
|
||||||
|
|
||||||
if (this.equals(toSub))
|
if (this.equals(toSub))
|
||||||
return false;
|
return false;
|
||||||
|
City nationCap = City.getCity(nation.cityUUID);
|
||||||
switch(this.guildState){
|
if (nation.getSubGuildList().size() >= nationCap.getRank()) {
|
||||||
case Nation:
|
canSub = false;
|
||||||
case Sovereign:
|
return canSub;
|
||||||
canSub = true;
|
}
|
||||||
|
switch(this.guildState) {
|
||||||
|
case Nation:
|
||||||
|
case Sovereign:
|
||||||
|
canSub = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
canSub = false;
|
canSub = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user