value is halfExtent
This commit is contained in:
@@ -446,14 +446,14 @@ public class Building extends AbstractWorldObject {
|
||||
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.extents))
|
||||
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.extents))
|
||||
if (this.getLoc().isInsideCircle(bane.getCity().getLoc(), CityBoundsType.ZONE.halfExtents))
|
||||
return bane.getCity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
Bounds cityBounds = Bounds.borrow();
|
||||
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
||||
new Vector2f(Enum.CityBoundsType.GRID.extents, Enum.CityBoundsType.GRID.extents),
|
||||
new Vector2f(Enum.CityBoundsType.GRID.halfExtents, Enum.CityBoundsType.GRID.halfExtents),
|
||||
0.0f);
|
||||
this.setBounds(cityBounds);
|
||||
|
||||
@@ -869,7 +869,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
public boolean isLocationWithinSiegeBounds(Vector3fImmutable insideLoc) {
|
||||
|
||||
return insideLoc.isInsideCircle(this.getLoc(), CityBoundsType.ZONE.extents);
|
||||
return insideLoc.isInsideCircle(this.getLoc(), CityBoundsType.ZONE.halfExtents);
|
||||
|
||||
}
|
||||
|
||||
@@ -934,7 +934,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
// Gather current list of players within the zone bounds
|
||||
|
||||
currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, CityBoundsType.ZONE.extents, MBServerStatics.MASK_PLAYER);
|
||||
currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, CityBoundsType.ZONE.halfExtents, MBServerStatics.MASK_PLAYER);
|
||||
currentMemory = new HashSet<>();
|
||||
|
||||
for (AbstractWorldObject playerObject : currentPlayers) {
|
||||
|
||||
@@ -116,8 +116,8 @@ public class Zone extends AbstractGameObject {
|
||||
|
||||
if (zone.playerCityID > 0) {
|
||||
writer.put((byte) 1); // Player City - True
|
||||
writer.putFloat(Enum.CityBoundsType.ZONE.extents);
|
||||
writer.putFloat(Enum.CityBoundsType.ZONE.extents);
|
||||
writer.putFloat(Enum.CityBoundsType.ZONE.halfExtents);
|
||||
writer.putFloat(Enum.CityBoundsType.ZONE.halfExtents);
|
||||
} else
|
||||
writer.put((byte) 0); // Player City - False
|
||||
|
||||
@@ -173,7 +173,7 @@ public class Zone extends AbstractGameObject {
|
||||
// Player cities are assigned default value
|
||||
|
||||
if (this.loadNum == 0) {
|
||||
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents), 0.0f);
|
||||
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.halfExtents, Enum.CityBoundsType.ZONE.halfExtents), 0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class Zone extends AbstractGameObject {
|
||||
if (zoneSize != null)
|
||||
this.bounds.setBounds(new Vector2f(this.absX, this.absZ), zoneSize, 0.0f);
|
||||
else
|
||||
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents), 0.0f);
|
||||
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.halfExtents, Enum.CityBoundsType.ZONE.halfExtents), 0.0f);
|
||||
|
||||
HeightMap heightMap = this.getHeightMap();
|
||||
|
||||
@@ -197,8 +197,8 @@ public class Zone extends AbstractGameObject {
|
||||
this.minBlend = Bounds.borrow();
|
||||
this.maxBlend = Bounds.borrow();
|
||||
|
||||
this.minBlend.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents).subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f);
|
||||
this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents).subtract(heightMap.zone_maxBlend, heightMap.zone_maxBlend), 0.0f);
|
||||
this.minBlend.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.halfExtents, Enum.CityBoundsType.ZONE.halfExtents).subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f);
|
||||
this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.halfExtents, Enum.CityBoundsType.ZONE.halfExtents).subtract(heightMap.zone_maxBlend, heightMap.zone_maxBlend), 0.0f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user