Browse Source

Bugfix in setparent.

combat-2
MagicBot 1 year ago
parent
commit
e4235d4d75
  1. 12
      src/engine/objects/Zone.java

12
src/engine/objects/Zone.java

@ -253,7 +253,17 @@ public class Zone extends AbstractGameObject {
this.setBounds(); this.setBounds();
if (this.getHeightMap() != null && this.getHeightMap().getSeaLevel() != 0) if (this.getParent() == null) {
this.seaLevel = 0;
return;
}
if (this.getHeightMap() == null) {
this.seaLevel = this.parent.seaLevel;
return;
}
if (this.getHeightMap().getSeaLevel() != 0)
this.seaLevel = this.worldAltitude + this.getHeightMap().getSeaLevel(); this.seaLevel = this.worldAltitude + this.getHeightMap().getSeaLevel();
else else
this.seaLevel = this.parent.seaLevel; this.seaLevel = this.parent.seaLevel;

Loading…
Cancel
Save