Browse Source

Zone size derived from template.

magicbox-1.5.2
MagicBot 12 months ago
parent
commit
f7a8ca33fc
  1. 13
      src/engine/objects/Zone.java

13
src/engine/objects/Zone.java

@ -76,9 +76,6 @@ public class Zone extends AbstractWorldObject {
this.templateID = rs.getInt("template"); this.templateID = rs.getInt("template");
this.zoneName = rs.getString("zone_name"); this.zoneName = rs.getString("zone_name");
this.peace_zone = rs.getByte("peace_zone"); 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.xOffset = rs.getFloat("xOffset");
this.zOffset = rs.getFloat("zOffset"); this.zOffset = rs.getFloat("zOffset");
this.yOffset = rs.getFloat("yOffset"); this.yOffset = rs.getFloat("yOffset");
@ -163,12 +160,16 @@ public class Zone extends AbstractWorldObject {
if (ZoneManager.seaFloor == null) if (ZoneManager.seaFloor == null)
ZoneManager.seaFloor = this; ZoneManager.seaFloor = this;
// Guild zones have a size of zero in the table // Guild zones use the enum CityBoundsType to adjust
// allowing the enum CityBoundsType to adjust them. // 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.minor_radius = Enum.CityBoundsType.ZONE.halfExtents;
this.major_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(); this.setParent();

Loading…
Cancel
Save