From 79919121a8ddc84f61c5a49d2ecbf926d25d9fe2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 26 Jun 2024 19:44:23 -0500 Subject: [PATCH] claiming an errant ToL gives ownership to the leader of the guild, not individual player --- src/engine/objects/City.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index 386e14c9..8f674de8 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -1197,14 +1197,18 @@ public class City extends AbstractWorldObject { // these assets are autoprotected. if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) { - - cityBuilding.claim(sourcePlayer); + PlayerCharacter guildLeader = PlayerCharacter.getPlayerCharacter(sourcePlayer.guild.getGuildLeaderUUID()); + if(guildLeader != null) + cityBuilding.claim(guildLeader); + else + cityBuilding.claim(sourcePlayer); cityBuilding.setProtectionState(ProtectionState.PROTECTED); } } this.setForceRename(true); + // Reset city timer for map update City.lastCityUpdate = System.currentTimeMillis();