forked from MagicBane/Server
Better handling of abandoned tols
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user