Logic cleanup pass for protectorate logic

This commit is contained in:
2026-05-10 18:45:37 -04:00
parent 24eb9608c3
commit f7249ba656
@@ -68,12 +68,14 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
} }
if (!nation.getSubGuildList().contains(protectorate)) { if (!nation.getSubGuildList().contains(protectorate)) {
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!"); ErrorPopupMsg.sendErrorMsg(player, "Guild is not a petitioner!");
return true; return true;
} }
if (protectorate.guildState.equals(GuildState.Petitioner) == false) if (protectorate.guildState.equals(GuildState.Petitioner) == false) {
ErrorPopupMsg.sendErrorMsg(player, "Guild is not a petitioner!");
return true; return true;
}
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false) { if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false) {
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!"); ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!");
@@ -85,16 +87,15 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
return true; return true;
} }
//shouldn't get here. // update Guild state.
if (protectorate.guildState.equals(GuildState.Petitioner)) // R8 is a province
GuildManager.updateAllGuildBinds(protectorate, nation.getOwnedCity());
//update Guild state.
if (protectorate.getNation().isEmptyGuild()) if (protectorate.getNation().isEmptyGuild())
protectorate.guildState = GuildState.Sworn; protectorate.guildState = GuildState.Sworn;
else else
protectorate.guildState = GuildState.Protectorate; protectorate.guildState = (protectorate.getOwnedCity().getTOL().getRank() == 8)
? GuildState.Province
: GuildState.Protectorate;
protectorate.setNation(nation); protectorate.setNation(nation);
GuildManager.updateAllGuildTags(protectorate); GuildManager.updateAllGuildTags(protectorate);