stairs region corrected

This commit is contained in:
2023-10-18 20:03:41 -05:00
parent 7886aa6041
commit 79eb5b9cdf
3 changed files with 9 additions and 5 deletions
+5 -4
View File
@@ -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() {