setLoc now handles region assignment

This commit is contained in:
2023-09-13 19:51:39 -05:00
parent f5d83aa259
commit 847e62dd27
4 changed files with 10 additions and 12 deletions
+10 -2
View File
@@ -983,8 +983,16 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
@Override
public final void setLoc(final Vector3fImmutable value) {
super.setLoc(value); // set the location in the world
this.resetLastSetLocUpdate();
Regions region = Regions.GetRegionForTeleport(value);
if(region != null){
this.region = region;
Vector3fImmutable newValue = new Vector3fImmutable(value.x,region.lerpY(this),value.z);
super.setLoc(newValue); // set the location in the world
this.resetLastSetLocUpdate();
} else {
super.setLoc(value); // set the location in the world
this.resetLastSetLocUpdate();
}
}
public Vector3fImmutable getMovementLoc() {