region work

This commit is contained in:
2023-10-27 23:29:54 -05:00
parent a2c7fd2404
commit 4229999848
8 changed files with 21 additions and 25 deletions
+2 -2
View File
@@ -179,7 +179,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
if (region.center.y == region.highLerp.y)
worldObject.loc = worldObject.loc.setY(region.center.y + worldObject.getAltitude());
else
worldObject.loc = worldObject.loc.setY(region.lerpY(worldObject) + worldObject.getAltitude());
worldObject.loc = worldObject.loc.setY(region.lerpY(worldObject.loc) + worldObject.getAltitude());
return region;
}
@@ -504,7 +504,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
this.loc = loc;
if(this instanceof AbstractCharacter && this.region != null){
this.loc = this.loc.setY(this.region.lerpY(this) + this.getAltitude());
this.loc = this.loc.setY(this.region.lerpY(this.loc) + this.getAltitude());
} else{
this.loc = this.loc.setY(Terrain.getWorldHeight(this.getLoc()) + this.getAltitude());
}