From 79eb5b9cdf23989c404bb9ce3ea4bcf7a9e03b3c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 18 Oct 2023 20:03:41 -0500 Subject: [PATCH] stairs region corrected --- src/engine/devcmd/cmds/RegionCmd.java | 3 ++- src/engine/objects/AbstractCharacter.java | 2 ++ src/engine/objects/Regions.java | 9 +++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/engine/devcmd/cmds/RegionCmd.java b/src/engine/devcmd/cmds/RegionCmd.java index 74da48fc..7ba118eb 100644 --- a/src/engine/devcmd/cmds/RegionCmd.java +++ b/src/engine/devcmd/cmds/RegionCmd.java @@ -44,7 +44,8 @@ public class RegionCmd extends AbstractDevCmd { output += "Player Info: " + ((AbstractCharacter) target).getName() + newline; output += "Region Building: " + building.getName() + newline; output += "Region Height: " + region.lerpY((AbstractCharacter)target) + newline; - output += "is Stairs: " + region.stairs + newline; + output += "is Stairs: " + region.isStairs() + newline; + output += "is Outside: " + region.isOutside(); this.throwbackInfo(pc, output); } diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index 41169b0b..a2abf80a 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -27,6 +27,7 @@ import engine.math.Bounds; import engine.math.Vector3fImmutable; import engine.net.ByteBufferWriter; import engine.net.DispatchMessage; +import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.UpdateStateMsg; import engine.powers.EffectsBase; import engine.server.MBServerStatics; @@ -1007,6 +1008,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { this.inBuildingID = 0; this.inFloorID = -1; } + float terrainHeight = Terrain.getWorldHeight(value); Vector3fImmutable finalLocation = new Vector3fImmutable(value.x,terrainHeight + regionHeightOffset, value.z); super.setLoc(finalLocation); // set the location in the world diff --git a/src/engine/objects/Regions.java b/src/engine/objects/Regions.java index 0b51baca..1683003c 100644 --- a/src/engine/objects/Regions.java +++ b/src/engine/objects/Regions.java @@ -170,10 +170,10 @@ public class Regions { return true; //next region is stairs, if they are on the same level as stairs or 1 up, world object can enter. - if (toEnter.stairs) + if (toEnter.isStairs()) if (worldObject.region.level == toEnter.level || toEnter.level - 1 == worldObject.region.level) return true; - if (worldObject.region.stairs) { + if (worldObject.region.isStairs()) { boolean movingUp = false; @@ -239,7 +239,7 @@ public class Regions { return true; //cant move up a level without stairs. - if (!fromRegion.stairs) + if (!fromRegion.isStairs()) return false; boolean movingUp = false; @@ -367,7 +367,8 @@ public class Regions { } public boolean isStairs() { - return stairs; + + return this.highLerp.y - this.lowLerp.y > 0.25f; } public boolean isExit() {