From 11ce89604c761ba21e2390a8f5afc1bd1b0804dc Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 16 Feb 2021 04:05:15 +0000 Subject: [PATCH] Prevent object creation from WarpedSpaceManager checks. --- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- .../java/org/l2jmobius/gameserver/geoengine/GeoEngine.java | 6 +++--- .../gameserver/instancemanager/WarpedSpaceManager.java | 7 +++---- 34 files changed, 102 insertions(+), 119 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index c92883bbe6..7691e5b35a 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -378,7 +378,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -450,7 +450,7 @@ public class GeoEngine { return false; } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(ox, oy, oz), new Location(tx, ty, tz), origin.getInstanceWorld())) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(ox, oy, oz, tx, ty, tz, origin.getInstanceWorld())) { return false; } @@ -810,7 +810,7 @@ public class GeoEngine { return new GeoLocation(gox, goy, goz); } - if (WarpedSpaceManager.getInstance().checkForWarpedSpace(new Location(gox, goy, goz), new Location(gtx, gty, gtz), instance)) + if (WarpedSpaceManager.getInstance().checkForWarpedSpace(gox, goy, goz, gtx, gty, gtz, instance)) { return new GeoLocation(gox, goy, goz); } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java index 5070126ea9..94d2416925 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/WarpedSpaceManager.java @@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.instancemanager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.holders.WarpedSpaceHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; @@ -52,7 +51,7 @@ public class WarpedSpaceManager _warpedSpace.remove(creature); } - public boolean checkForWarpedSpace(Location origin, Location destination, Instance instance) + public boolean checkForWarpedSpace(int originX, int originY, int originZ, int destinationX, int destinationY, int destinationZ, Instance instance) { if (_warpedSpace != null) { @@ -64,8 +63,8 @@ public class WarpedSpaceManager continue; } final int radius = creature.getTemplate().getCollisionRadius(); - final boolean originInRange = Util.calculateDistance(creature, origin, false, false) <= (holder.getRange() + radius); - final boolean destinationInRange = Util.calculateDistance(creature, destination, false, false) <= (holder.getRange() + radius); + final boolean originInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), originX, originY, originZ, false, false) <= (holder.getRange() + radius); + final boolean destinationInRange = Util.calculateDistance(creature.getX(), creature.getY(), creature.getZ(), destinationX, destinationY, destinationZ, false, false) <= (holder.getRange() + radius); return destinationInRange ? !originInRange : originInRange; } }