Better handling of abandoned tols

This commit is contained in:
2026-07-26 17:02:01 -04:00
parent 46045895d7
commit 19e6c182c0
@@ -166,16 +166,24 @@ public class AbandonAssetMsgHandler extends AbstractClientMsgHandler {
return;
}
// Dislodge any realm
if (sourceGuild.getOwnedCity().realm != null)
sourceGuild.getOwnedCity().realm.abandonRealm();
if (sourceGuild.getNation().equals(sourceGuild))
sourceGuild.guildState = GuildState.Errant;
else
sourceGuild.guildState = GuildState.Sworn;
sourceGuild.setCityUUID(0);
// Guild no longer owns his tree.
if (!DbManager.GuildQueries.SET_GUILD_OWNED_CITY(sourceGuild.getObjectUUID(), 0)) {
Logger.error("Failed to update Owned City to Database");
return;
}
sourceGuild.setCityUUID(0);
sourceGuild.guildState = GuildState.Errant;
sourceGuild.setNation(null);
// Transfer the city assets
TransferCityAssets(sourcePlayer, targetBuilding);