From ecc7a152f7ca8f479a09a8fdb8e32ea7e2654c2a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 11 Sep 2023 11:08:03 -0400 Subject: [PATCH] DevCmd update. --- src/engine/devcmd/cmds/GetHeightCmd.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/engine/devcmd/cmds/GetHeightCmd.java b/src/engine/devcmd/cmds/GetHeightCmd.java index a5dc2a1f..2de8cb42 100644 --- a/src/engine/devcmd/cmds/GetHeightCmd.java +++ b/src/engine/devcmd/cmds/GetHeightCmd.java @@ -24,20 +24,26 @@ public class GetHeightCmd extends AbstractDevCmd { } @Override - protected void _doCmd(PlayerCharacter pc, String[] words, + protected void _doCmd(PlayerCharacter playerCharacter, String[] words, AbstractGameObject target) { - float height = HeightMap.getWorldHeight(pc.getLoc()); + Zone currentZone; + Zone parentZone; - this.throwbackInfo(pc, "Altitude : " + height); + currentZone = ZoneManager.findSmallestZone(playerCharacter.getLoc()); + parentZone = currentZone.getParent(); - this.throwbackInfo(pc, "Character Height: " + pc.getCharacterHeight()); - this.throwbackInfo(pc, "Character Height to start swimming: " + pc.centerHeight); + float currentHeight = HeightMap.getWorldHeight(currentZone, playerCharacter.getLoc()); + float parentHeight = HeightMap.getWorldHeight(parentZone, playerCharacter.getLoc()); - Zone zone = ZoneManager.findSmallestZone(pc.getLoc()); - this.throwbackInfo(pc, "Water Level : " + zone.getSeaLevel()); - this.throwbackInfo(pc, "Character Water Level Above : " + (pc.getCharacterHeight() + height - zone.getSeaLevel())); + this.throwbackInfo(playerCharacter, "Altitude : " + currentHeight); + this.throwbackInfo(playerCharacter, "Parent Altitude : " + parentHeight); + this.throwbackInfo(playerCharacter, "Character Height: " + playerCharacter.getCharacterHeight()); + this.throwbackInfo(playerCharacter, "Character Height to start swimming: " + playerCharacter.centerHeight); + + this.throwbackInfo(playerCharacter, "Water Level : " + currentZone.getSeaLevel()); + this.throwbackInfo(playerCharacter, "Character Water Level Above : " + (playerCharacter.getCharacterHeight() + currentHeight - currentZone.getSeaLevel())); }