From d5fc87c233dffd9f4fd608e382f2f4e7788cfd19 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 4 Jan 2024 12:43:30 -0500 Subject: [PATCH] Update to player city size handling. --- src/engine/objects/Zone.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index e380a3fd..a7dfe6ca 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -37,8 +37,8 @@ public class Zone extends AbstractWorldObject { public final int playerCityUUID; public final String zoneName; - public final float major_radius; - public final float minor_radius; + public float major_radius; + public float minor_radius; public final float xOffset; public final float zOffset; public final float yOffset; @@ -163,6 +163,14 @@ public class Zone extends AbstractWorldObject { if (ZoneManager.seaFloor == null) ZoneManager.seaFloor = this; + // Guild zones have a size of zero in the table + // allowing the enum CityBoundsType to adjust them. + + if (this.major_radius == 0) { + this.minor_radius = Enum.CityBoundsType.ZONE.halfExtents; + this.major_radius = Enum.CityBoundsType.ZONE.halfExtents; + } + this.setParent(); this.setBounds(); @@ -192,7 +200,7 @@ public class Zone extends AbstractWorldObject { // Set initial bounds object this.bounds = Bounds.borrow(); - this.bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(this.template.major_radius, this.template.minor_radius), 0.0f); + this.bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(this.major_radius, this.minor_radius), 0.0f); }