Browse Source

Update to world altitude calculation

feature-workorder
MagicBot 1 year ago
parent
commit
6ef33c5b7f
  1. 12
      src/engine/gameManager/ZoneManager.java

12
src/engine/gameManager/ZoneManager.java

@ -459,15 +459,21 @@ public enum ZoneManager {
float worldAlttitude = MBServerStatics.SEA_FLOOR_ALTITUDE; float worldAlttitude = MBServerStatics.SEA_FLOOR_ALTITUDE;
if (getSeaFloor().getObjectUUID() == zone.getObjectUUID()) {
// Seafloor
if (zone.getParent() == null) {
return worldAlttitude; return worldAlttitude;
} }
Zone parentZone = zone.getParent(); Zone parentZone = zone.getParent();
if (getSeaFloor().getObjectUUID() == parentZone.getObjectUUID()) { // Child of seafloor
if (parentZone.getParent() == null)
return worldAlttitude + zone.getYCoord(); return worldAlttitude + zone.getYCoord();
}
// return height from heightmap engine at zone location
worldAlttitude = HeightMap.getWorldHeight(parentZone, zone.getLoc()); worldAlttitude = HeightMap.getWorldHeight(parentZone, zone.getLoc());

Loading…
Cancel
Save