Browse Source

Sea level logic updated.

feature-workorder
MagicBot 1 year ago
parent
commit
967e129724
  1. 28
      src/engine/objects/Zone.java

28
src/engine/objects/Zone.java

@ -229,31 +229,29 @@ public class Zone extends AbstractGameObject {
this.parent = value; this.parent = value;
this.parentZoneID = (this.parent != null) ? this.parent.getObjectUUID() : 0; this.parentZoneID = (this.parent != null) ? this.parent.getObjectUUID() : 0;
if (this.parent != null) {
this.absX = this.xCoord + parent.absX;
this.absY = this.yCoord + parent.absY;
this.absZ = this.zCoord + parent.absZ;
if (this.minLvl == 0 || this.maxLvl == 0) {
this.minLvl = this.parent.minLvl;
this.maxLvl = this.parent.maxLvl;
}
} else { //only the Sea Floor zone does not have a parent
this.absX = this.xCoord;
this.absY = MBServerStatics.SEA_FLOOR_ALTITUDE;
this.absZ = this.zCoord;
}
// Zone AABB is set here as it's coordinate space is world requiring a parent. // Zone AABB is set here as it's coordinate space is world requiring a parent.
this.setBounds(); this.setBounds();
// Seafloor // Seafloor
if (this.parent == null) { if (this.parent == null) {
this.absX = this.xCoord;
this.absY = MBServerStatics.SEA_FLOOR_ALTITUDE;
this.absZ = this.zCoord;
this.seaLevel = 0; this.seaLevel = 0;
return; return;
} }
this.absX = this.xCoord + parent.absX;
this.absY = this.yCoord + parent.absY;
this.absZ = this.zCoord + parent.absZ;
if (this.minLvl == 0 || this.maxLvl == 0) {
this.minLvl = this.parent.minLvl;
this.maxLvl = this.parent.maxLvl;
}
if (this.getHeightMap() != null && this.getHeightMap().getSeaLevel() != 0) if (this.getHeightMap() != null && this.getHeightMap().getSeaLevel() != 0)
this.seaLevel = this.worldAltitude + this.getHeightMap().getSeaLevel(); this.seaLevel = this.worldAltitude + this.getHeightMap().getSeaLevel();
else else

Loading…
Cancel
Save