setLoc now handles region assignment
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user