From f7a8ca33fc5a7570215c840b6295dabfa78f667a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 9 Jan 2024 12:55:08 -0500 Subject: [PATCH] Zone size derived from template. --- src/engine/objects/Zone.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index a7dfe6ca..4bc30406 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -76,9 +76,6 @@ public class Zone extends AbstractWorldObject { this.templateID = rs.getInt("template"); this.zoneName = rs.getString("zone_name"); this.peace_zone = rs.getByte("peace_zone"); - - this.major_radius = rs.getFloat("major_radius"); - this.minor_radius = rs.getFloat("minor_radius"); this.xOffset = rs.getFloat("xOffset"); this.zOffset = rs.getFloat("zOffset"); this.yOffset = rs.getFloat("yOffset"); @@ -163,12 +160,16 @@ 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. + // Guild zones use the enum CityBoundsType to adjust + // city size. All other zones derive from the JSON + // stored within its template. - if (this.major_radius == 0) { + if (this.template == null) { this.minor_radius = Enum.CityBoundsType.ZONE.halfExtents; this.major_radius = Enum.CityBoundsType.ZONE.halfExtents; + } else { + this.minor_radius = this.template.minor_radius; + this.major_radius = this.template.major_radius; } this.setParent();