Better handling of abandoned tols
This commit is contained in:
@@ -166,16 +166,24 @@ public class AbandonAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
return;
|
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.
|
// Guild no longer owns his tree.
|
||||||
if (!DbManager.GuildQueries.SET_GUILD_OWNED_CITY(sourceGuild.getObjectUUID(), 0)) {
|
if (!DbManager.GuildQueries.SET_GUILD_OWNED_CITY(sourceGuild.getObjectUUID(), 0)) {
|
||||||
Logger.error("Failed to update Owned City to Database");
|
Logger.error("Failed to update Owned City to Database");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceGuild.setCityUUID(0);
|
|
||||||
sourceGuild.guildState = GuildState.Errant;
|
|
||||||
sourceGuild.setNation(null);
|
|
||||||
|
|
||||||
// Transfer the city assets
|
// Transfer the city assets
|
||||||
TransferCityAssets(sourcePlayer, targetBuilding);
|
TransferCityAssets(sourcePlayer, targetBuilding);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user