Browse Source

Update to player city size handling.

combat-2
MagicBot 11 months ago
parent
commit
d5fc87c233
  1. 14
      src/engine/objects/Zone.java

14
src/engine/objects/Zone.java

@ -37,8 +37,8 @@ public class Zone extends AbstractWorldObject { @@ -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 { @@ -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 { @@ -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);
}

Loading…
Cancel
Save