|
|
|
@ -287,30 +287,7 @@ public class Building extends AbstractWorldObject {
@@ -287,30 +287,7 @@ public class Building extends AbstractWorldObject {
|
|
|
|
|
|
|
|
|
|
public final City getCity() { |
|
|
|
|
|
|
|
|
|
if (this.parentZone == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
if (this.getBlueprint() != null && this.getBlueprint().isSiegeEquip() && this.protectionState.equals(ProtectionState.PROTECTED)) { |
|
|
|
|
if (this.getGuild() != null) { |
|
|
|
|
if (this.getGuild().getOwnedCity() != null) { |
|
|
|
|
if (this.getLoc().isInsideCircle(this.getGuild().getOwnedCity().getLoc(), CityBoundsType.ZONE.halfExtents)) |
|
|
|
|
return this.getGuild().getOwnedCity(); |
|
|
|
|
} else { |
|
|
|
|
Bane bane = Bane.getBaneByAttackerGuild(this.getGuild()); |
|
|
|
|
|
|
|
|
|
if (bane != null) { |
|
|
|
|
if (bane.getCity() != null) { |
|
|
|
|
if (this.getLoc().isInsideCircle(bane.getCity().getLoc(), CityBoundsType.ZONE.halfExtents)) |
|
|
|
|
return bane.getCity(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this.parentZone.guild_zone == false) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
return City.getCity(this.parentZone.playerCityUUID); |
|
|
|
|
return ZoneManager.getCityAtLocation(this.getLoc()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|