From 924b8af827fdb264ef34bcc688058679f9f1bef3 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 12 Sep 2023 14:57:47 -0400 Subject: [PATCH] Sea level logic updated. --- src/engine/objects/Zone.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index 21dc294e..9280ca6a 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -247,8 +247,15 @@ public class Zone extends AbstractGameObject { // Zone AABB is set here as it's coordinate space is world requiring a parent. this.setBounds(); + if (ZoneManager.getSeaFloor().equals(this)) { + this.seaLevel = 0; + return; + } + if (this.getHeightMap() != null && this.getHeightMap().getSeaLevel() != 0) - this.seaLevel = this.getHeightMap().getSeaLevel(); + this.seaLevel = this.worldAltitude + this.getHeightMap().getSeaLevel(); + else + this.seaLevel = this.parent.seaLevel; }