Cleanup of guildstate on boot
This commit is contained in:
@@ -181,6 +181,19 @@ public enum GuildManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static mbEnums.GuildState calcuateGuildState(Guild guild) {
|
||||||
|
|
||||||
|
if (guild.getNation() == guild)
|
||||||
|
return guild.getSubGuildList().isEmpty() ? mbEnums.GuildState.Sovereign : mbEnums.GuildState.Nation;
|
||||||
|
|
||||||
|
if (guild.getOwnedCity() == null)
|
||||||
|
return guild.getNation().isEmptyGuild() ? mbEnums.GuildState.Errant : mbEnums.GuildState.Sworn;
|
||||||
|
|
||||||
|
return (guild.getOwnedCity().getTOL().getRank() == 8)
|
||||||
|
? mbEnums.GuildState.Province
|
||||||
|
: mbEnums.GuildState.Protectorate;
|
||||||
|
}
|
||||||
|
|
||||||
//This updates tags for all online players in a guild.
|
//This updates tags for all online players in a guild.
|
||||||
public static void updateAllGuildTags(Guild guild) {
|
public static void updateAllGuildTags(Guild guild) {
|
||||||
|
|
||||||
|
|||||||
@@ -760,18 +760,9 @@ public class Guild extends AbstractWorldObject {
|
|||||||
Logger.error("FAILED TO LOAD SUB GUILDS FOR UUID " + this.getObjectUUID());
|
Logger.error("FAILED TO LOAD SUB GUILDS FOR UUID " + this.getObjectUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.nation == this && subGuildList.size() > 0)
|
this.guildState = GuildManager.calcuateGuildState(this);
|
||||||
this.guildState = GuildState.Nation;
|
|
||||||
else if (this.nation.equals(this))
|
|
||||||
this.guildState = GuildState.Sovereign;
|
|
||||||
else if (!this.nation.isEmptyGuild() && this.cityUUID != 0)
|
|
||||||
this.guildState = GuildState.Province;
|
|
||||||
else if (!this.nation.isEmptyGuild())
|
|
||||||
this.guildState = GuildState.Sworn;
|
|
||||||
else
|
|
||||||
this.guildState = GuildState.Errant;
|
|
||||||
|
|
||||||
if (this.cityUUID == 0)
|
if (this.getOwnedCity() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Calculate number of realms this guild controls
|
// Calculate number of realms this guild controls
|
||||||
|
|||||||
Reference in New Issue
Block a user