Bugfix in setparent.

This commit is contained in:
2023-09-14 09:13:02 -04:00
parent 41a83115be
commit e4235d4d75
+11 -1
View File
@@ -253,7 +253,17 @@ public class Zone extends AbstractGameObject {
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();
else
this.seaLevel = this.parent.seaLevel;