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)) {
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!");
ErrorPopupMsg.sendErrorMsg(player, "Guild is not a petitioner!");
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;
}
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false) {
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!");
@@ -85,16 +87,15 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
return true;
}
//shouldn't get here.
if (protectorate.guildState.equals(GuildState.Petitioner))
GuildManager.updateAllGuildBinds(protectorate, nation.getOwnedCity());
//update Guild state.
// update Guild state.
// R8 is a province
if (protectorate.getNation().isEmptyGuild())
protectorate.guildState = GuildState.Sworn;
else
protectorate.guildState = GuildState.Protectorate;
protectorate.guildState = (protectorate.getOwnedCity().getTOL().getRank() == 8)
? GuildState.Province
: GuildState.Protectorate;
protectorate.setNation(nation);
GuildManager.updateAllGuildTags(protectorate);