Browse Source

setRegion removal

combat-2
FatBoy-DOTC 1 year ago
parent
commit
a313e3f364
  1. 3
      src/engine/gameManager/MovementManager.java
  2. 2
      src/engine/jobs/FinishSummonsJob.java
  3. 2
      src/engine/mobileAI/MobAI.java
  4. 1
      src/engine/net/client/handlers/RequestEnterWorldHandler.java
  5. 6
      src/engine/objects/AbstractCharacter.java
  6. 3
      src/engine/objects/PlayerCharacter.java
  7. 2
      src/engine/powers/poweractions/MobRecallPowerAction.java
  8. 2
      src/engine/powers/poweractions/RecallPowerAction.java
  9. 2
      src/engine/powers/poweractions/TeleportPowerAction.java

3
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) if (targetLoc == null)
@ -473,7 +473,6 @@ public enum MovementManager {
Vector3fImmutable oldLoc = new Vector3fImmutable(teleporter.getLoc()); Vector3fImmutable oldLoc = new Vector3fImmutable(teleporter.getLoc());
teleporter.stopMovement(targetLoc); teleporter.stopMovement(targetLoc);
teleporter.setRegion(region);
//mobs ignore region sets for now. //mobs ignore region sets for now.
if (teleporter.getObjectType().equals(GameObjectType.Mob)) { if (teleporter.getObjectType().equals(GameObjectType.Mob)) {

2
src/engine/jobs/FinishSummonsJob.java

@ -61,8 +61,6 @@ public class FinishSummonsJob extends AbstractScheduleJob {
return; return;
} }
if (this.source.region != null)
this.target.setRegion(this.source.region);
//teleport target to source //teleport target to source
target.teleport(source.getLoc()); target.teleport(source.getLoc());
} }

2
src/engine/mobileAI/MobAI.java

@ -736,7 +736,7 @@ public class MobAI {
//mob no longer has its owner loaded, translate pet to owner //mob no longer has its owner loaded, translate pet to owner
if (!mob.playerAgroMap.containsKey(mob.guardCaptain.getObjectUUID())) { if (!mob.playerAgroMap.containsKey(mob.guardCaptain.getObjectUUID())) {
MovementManager.translocate(mob, mob.guardCaptain.getLoc(), null); MovementManager.translocate(mob, mob.guardCaptain.getLoc());
return; return;
} }

1
src/engine/net/client/handlers/RequestEnterWorldHandler.java

@ -110,7 +110,6 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
player.stopMovement(player.getBindLoc()); player.stopMovement(player.getBindLoc());
player.setSafeMode(); player.setSafeMode();
player.updateLocation(); player.updateLocation();
player.setRegion(AbstractWorldObject.GetRegionByWorldObject(player));
} }
player.setTimeStamp("logout", 0); player.setTimeStamp("logout", 0);

6
src/engine/objects/AbstractCharacter.java

@ -512,10 +512,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
} }
public static void teleport(AbstractCharacter worldObject, final Vector3fImmutable targetLoc) { public static void teleport(AbstractCharacter worldObject, final Vector3fImmutable targetLoc) {
Regions targetRegion = Regions.GetRegionForTeleport(targetLoc);
worldObject.locationLock.writeLock().lock(); worldObject.locationLock.writeLock().lock();
try { try {
MovementManager.translocate(worldObject, targetLoc, targetRegion); MovementManager.translocate(worldObject, targetLoc);
if (worldObject.getObjectType().equals(GameObjectType.PlayerCharacter)) if (worldObject.getObjectType().equals(GameObjectType.PlayerCharacter))
InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) worldObject); InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) worldObject);
} catch (Exception e) { } catch (Exception e) {
@ -1458,10 +1457,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
} }
public void teleport(final Vector3fImmutable targetLoc) { public void teleport(final Vector3fImmutable targetLoc) {
Regions targetRegion = Regions.GetRegionForTeleport(targetLoc);
locationLock.writeLock().lock(); locationLock.writeLock().lock();
try { try {
MovementManager.translocate(this, targetLoc, targetRegion); MovementManager.translocate(this, targetLoc);
MovementManager.sendRWSSMsg(this); MovementManager.sendRWSSMsg(this);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);

3
src/engine/objects/PlayerCharacter.java

@ -5472,11 +5472,10 @@ public class PlayerCharacter extends AbstractCharacter {
@Override @Override
public final void teleport(final Vector3fImmutable targetLoc) { public final void teleport(final Vector3fImmutable targetLoc) {
Regions targetRegion = Regions.GetRegionForTeleport(targetLoc);
locationLock.writeLock().lock(); locationLock.writeLock().lock();
try { try {
MovementManager.translocate(this, targetLoc, targetRegion); MovementManager.translocate(this, targetLoc);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
} finally { } finally {

2
src/engine/powers/poweractions/MobRecallPowerAction.java

@ -38,7 +38,7 @@ public class MobRecallPowerAction extends AbstractPowerAction {
return; return;
MovementManager.translocate(awoac, awoac.getBindLoc(), null); MovementManager.translocate(awoac, awoac.getBindLoc());
if (awoac.getObjectType() == GameObjectType.Mob) { if (awoac.getObjectType() == GameObjectType.Mob) {
//MobAI.setAwake((Mob)awoac,true); //MobAI.setAwake((Mob)awoac,true);
((Mob) awoac).setCombatTarget(null); ((Mob) awoac).setCombatTarget(null);

2
src/engine/powers/poweractions/RecallPowerAction.java

@ -58,7 +58,7 @@ public class RecallPowerAction extends AbstractPowerAction {
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
} else { } else {
MovementManager.translocate(awoac, awoac.getBindLoc(), null); MovementManager.translocate(awoac, awoac.getBindLoc());
} }
} else { } else {
Vector3fImmutable bindloc = awoac.getBindLoc(); Vector3fImmutable bindloc = awoac.getBindLoc();

2
src/engine/powers/poweractions/TeleportPowerAction.java

@ -101,7 +101,7 @@ public class TeleportPowerAction extends AbstractPowerAction {
if (region != null && !region.isOutside()) if (region != null && !region.isOutside())
return; return;
MovementManager.translocate(awoac, targetLoc, region); MovementManager.translocate(awoac, targetLoc);
} }
@Override @Override

Loading…
Cancel
Save