Use simplified Math hypot method to calculate distance.
This commit is contained in:
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3513,7 +3513,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3534,7 +3534,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
@@ -3513,7 +3513,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3534,7 +3534,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3513,7 +3513,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3534,7 +3534,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
@@ -3512,7 +3512,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3533,7 +3533,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
@@ -3512,7 +3512,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3533,7 +3533,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -5408,7 +5408,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isNpc() && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -5429,7 +5429,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceId(), false);
|
||||
|
||||
@@ -5454,7 +5454,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isNpc() && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -5475,7 +5475,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceId(), false);
|
||||
|
||||
@@ -4291,7 +4291,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -4312,7 +4312,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceId(), false);
|
||||
|
||||
@@ -4476,7 +4476,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -4497,7 +4497,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceId(), false);
|
||||
|
||||
@@ -4478,7 +4478,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -4499,7 +4499,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceId(), false);
|
||||
|
||||
+2
-2
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3527,7 +3527,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3548,7 +3548,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3527,7 +3527,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3548,7 +3548,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3526,7 +3526,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3547,7 +3547,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3514,7 +3514,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3529,7 +3529,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3550,7 +3550,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3536,7 +3536,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3557,7 +3557,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3556,7 +3556,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
+2
-2
@@ -3535,7 +3535,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayer());
|
||||
boolean found = (m.geoPath != null) && (m.geoPath.size() > 1);
|
||||
|
||||
// If not found and it is an Attackable, attempt to find closest path to move location.
|
||||
// If path not found and this is an Attackable, attempt to find closest path to destination.
|
||||
if (!found && isAttackable())
|
||||
{
|
||||
int xMin = Math.min(curX, originalX);
|
||||
@@ -3556,7 +3556,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
for (int sY = yMin; sY < yMax; sY += 500)
|
||||
{
|
||||
tempDistance = Math.sqrt(Math.pow(sX - originalX, 2) + Math.pow(sY - originalY, 2));
|
||||
tempDistance = Math.hypot(sX - originalX, sY - originalY);
|
||||
if (tempDistance < shortDistance)
|
||||
{
|
||||
tempPath = PathFinding.getInstance().findPath(curX, curY, curZ, sX, sY, originalZ, getInstanceWorld(), false);
|
||||
|
||||
Reference in New Issue
Block a user