From a313e3f3646bd1ea0a9010acd1289e58a6c010bf Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 13 Sep 2023 19:56:54 -0500 Subject: [PATCH] setRegion removal --- src/engine/gameManager/MovementManager.java | 3 +-- src/engine/jobs/FinishSummonsJob.java | 2 -- src/engine/mobileAI/MobAI.java | 2 +- .../net/client/handlers/RequestEnterWorldHandler.java | 1 - src/engine/objects/AbstractCharacter.java | 6 ++---- src/engine/objects/PlayerCharacter.java | 3 +-- src/engine/powers/poweractions/MobRecallPowerAction.java | 2 +- src/engine/powers/poweractions/RecallPowerAction.java | 2 +- src/engine/powers/poweractions/TeleportPowerAction.java | 2 +- 9 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/engine/gameManager/MovementManager.java b/src/engine/gameManager/MovementManager.java index a602169f..6bc4ced5 100644 --- a/src/engine/gameManager/MovementManager.java +++ b/src/engine/gameManager/MovementManager.java @@ -464,7 +464,7 @@ public enum MovementManager { } } - public static void translocate(AbstractCharacter teleporter, Vector3fImmutable targetLoc, Regions region) { + public static void translocate(AbstractCharacter teleporter, Vector3fImmutable targetLoc) { if (targetLoc == null) @@ -473,7 +473,6 @@ public enum MovementManager { Vector3fImmutable oldLoc = new Vector3fImmutable(teleporter.getLoc()); teleporter.stopMovement(targetLoc); - teleporter.setRegion(region); //mobs ignore region sets for now. if (teleporter.getObjectType().equals(GameObjectType.Mob)) { diff --git a/src/engine/jobs/FinishSummonsJob.java b/src/engine/jobs/FinishSummonsJob.java index 0ee0fc68..3c0c269a 100644 --- a/src/engine/jobs/FinishSummonsJob.java +++ b/src/engine/jobs/FinishSummonsJob.java @@ -61,8 +61,6 @@ public class FinishSummonsJob extends AbstractScheduleJob { return; } - if (this.source.region != null) - this.target.setRegion(this.source.region); //teleport target to source target.teleport(source.getLoc()); } diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 8b710e4b..10696af9 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -736,7 +736,7 @@ public class MobAI { //mob no longer has its owner loaded, translate pet to owner if (!mob.playerAgroMap.containsKey(mob.guardCaptain.getObjectUUID())) { - MovementManager.translocate(mob, mob.guardCaptain.getLoc(), null); + MovementManager.translocate(mob, mob.guardCaptain.getLoc()); return; } diff --git a/src/engine/net/client/handlers/RequestEnterWorldHandler.java b/src/engine/net/client/handlers/RequestEnterWorldHandler.java index 18b48254..e1654e6b 100644 --- a/src/engine/net/client/handlers/RequestEnterWorldHandler.java +++ b/src/engine/net/client/handlers/RequestEnterWorldHandler.java @@ -110,7 +110,6 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler { player.stopMovement(player.getBindLoc()); player.setSafeMode(); player.updateLocation(); - player.setRegion(AbstractWorldObject.GetRegionByWorldObject(player)); } player.setTimeStamp("logout", 0); diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index a2fbd429..1017e337 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -512,10 +512,9 @@ 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, targetRegion); + MovementManager.translocate(worldObject, targetLoc); if (worldObject.getObjectType().equals(GameObjectType.PlayerCharacter)) InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) worldObject); } catch (Exception e) { @@ -1458,10 +1457,9 @@ 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, targetRegion); + MovementManager.translocate(this, targetLoc); MovementManager.sendRWSSMsg(this); } catch (Exception e) { Logger.error(e); diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index cd24f990..32a536bc 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -5472,11 +5472,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, targetRegion); + MovementManager.translocate(this, targetLoc); } catch (Exception e) { Logger.error(e); } finally { diff --git a/src/engine/powers/poweractions/MobRecallPowerAction.java b/src/engine/powers/poweractions/MobRecallPowerAction.java index d5318fcf..44fb93e8 100644 --- a/src/engine/powers/poweractions/MobRecallPowerAction.java +++ b/src/engine/powers/poweractions/MobRecallPowerAction.java @@ -38,7 +38,7 @@ public class MobRecallPowerAction extends AbstractPowerAction { return; - MovementManager.translocate(awoac, awoac.getBindLoc(), null); + MovementManager.translocate(awoac, awoac.getBindLoc()); if (awoac.getObjectType() == GameObjectType.Mob) { //MobAI.setAwake((Mob)awoac,true); ((Mob) awoac).setCombatTarget(null); diff --git a/src/engine/powers/poweractions/RecallPowerAction.java b/src/engine/powers/poweractions/RecallPowerAction.java index c0ffb409..8a0f6050 100644 --- a/src/engine/powers/poweractions/RecallPowerAction.java +++ b/src/engine/powers/poweractions/RecallPowerAction.java @@ -58,7 +58,7 @@ public class RecallPowerAction extends AbstractPowerAction { DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY); } else { - MovementManager.translocate(awoac, awoac.getBindLoc(), null); + MovementManager.translocate(awoac, awoac.getBindLoc()); } } else { Vector3fImmutable bindloc = awoac.getBindLoc(); diff --git a/src/engine/powers/poweractions/TeleportPowerAction.java b/src/engine/powers/poweractions/TeleportPowerAction.java index 36eed471..5f0c6e31 100644 --- a/src/engine/powers/poweractions/TeleportPowerAction.java +++ b/src/engine/powers/poweractions/TeleportPowerAction.java @@ -101,7 +101,7 @@ public class TeleportPowerAction extends AbstractPowerAction { if (region != null && !region.isOutside()) return; - MovementManager.translocate(awoac, targetLoc, region); + MovementManager.translocate(awoac, targetLoc); } @Override