setLoc now handles region assignment
This commit is contained in:
1 parent
f5d83aa259
commit
847e62dd27
4 files changed
+10
-12
No files matched your search
@@ -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