From 8a8bf8d2f90c9f31759ab59001944b7867362158 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 22 Jul 2023 12:44:59 -0500 Subject: [PATCH] region support for teleporting --- src/engine/objects/AbstractCharacter.java | 6 ++++-- src/engine/objects/PlayerCharacter.java | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index 161968b2..5728617b 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -535,9 +535,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject { } public static void teleport(AbstractCharacter worldObject, final Vector3fImmutable targetLoc) { + Regions targetRegion = Regions.GetRegionForTeleport(targetLoc); worldObject.locationLock.writeLock().lock(); try { - MovementManager.translocate(worldObject, targetLoc, null); + MovementManager.translocate(worldObject, targetLoc, targetRegion); if (worldObject.getObjectType().equals(GameObjectType.PlayerCharacter)) InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) worldObject); } catch (Exception e) { @@ -1466,9 +1467,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject { } public void teleport(final Vector3fImmutable targetLoc) { + Regions targetRegion = Regions.GetRegionForTeleport(targetLoc); locationLock.writeLock().lock(); try { - MovementManager.translocate(this, targetLoc, null); + MovementManager.translocate(this, targetLoc, targetRegion); MovementManager.sendRWSSMsg(this); } catch (Exception e) { Logger.error(e); diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 41d141fc..49f23de2 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -5502,9 +5502,10 @@ public class PlayerCharacter extends AbstractCharacter { @Override public final void teleport(final Vector3fImmutable targetLoc) { + Regions targetRegion = Regions.GetRegionForTeleport(targetLoc); locationLock.writeLock().lock(); try { - MovementManager.translocate(this, targetLoc, null); + MovementManager.translocate(this, targetLoc, targetRegion); } catch (Exception e) { Logger.error(e); } finally {