forked from MagicBane/Server
teleport cleanup
This commit is contained in:
@@ -469,25 +469,8 @@ public enum MovementManager {
|
|||||||
|
|
||||||
if (targetLoc == null)
|
if (targetLoc == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vector3fImmutable oldLoc = new Vector3fImmutable(teleporter.getLoc());
|
|
||||||
|
|
||||||
teleporter.stopMovement(targetLoc);
|
teleporter.stopMovement(targetLoc);
|
||||||
|
teleporter.setLoc(targetLoc);
|
||||||
//mobs ignore region sets for now.
|
|
||||||
if (teleporter.getObjectType().equals(GameObjectType.Mob)) {
|
|
||||||
teleporter.setInBuildingID(0);
|
|
||||||
teleporter.setInBuilding(-1);
|
|
||||||
teleporter.setInFloorID(-1);
|
|
||||||
TeleportToPointMsg msg = new TeleportToPointMsg(teleporter, targetLoc.getX(), targetLoc.getY(), targetLoc.getZ(), 0, -1, -1);
|
|
||||||
DispatchMessage.dispatchMsgToInterestArea(oldLoc, teleporter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
TeleportToPointMsg msg = new TeleportToPointMsg(teleporter, targetLoc.getX(), targetLoc.getY(), targetLoc.getZ(), 0, -1, -1);
|
|
||||||
//we shouldnt need to send teleport message to new area, as loadjob should pick it up.
|
|
||||||
// DispatchMessage.dispatchMsgToInterestArea(teleporter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
|
||||||
DispatchMessage.dispatchMsgToInterestArea(oldLoc, teleporter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
|
||||||
|
|
||||||
if (teleporter.getObjectType().equals(GameObjectType.PlayerCharacter))
|
if (teleporter.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||||
InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) teleporter);
|
InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) teleporter);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user