Player moving on ledges check replaced by combined Water-Castle check.

This commit is contained in:
MobiusDevelopment 2023-02-07 01:26:07 +02:00
parent 2a8040a745
commit 4c1957ff3d
31 changed files with 144 additions and 555 deletions

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3275,25 +3275,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3320,7 +3307,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3522,7 +3509,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3275,25 +3275,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3320,7 +3307,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3522,7 +3509,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3275,25 +3275,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3320,7 +3307,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3522,7 +3509,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3285,25 +3285,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3330,7 +3317,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3532,7 +3519,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3285,25 +3285,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3330,7 +3317,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3532,7 +3519,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -4950,18 +4950,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
double dx = m._xDestination - m._xAccurate;
double dy = m._yDestination - m._yAccurate;
double dz = m._zDestination - zPrev; // Z coordinate will follow client values
float speed;
if (this instanceof Boat)
{
speed = ((Boat) this).boatSpeed;
}
else
{
speed = getStat().getMoveSpeed();
}
if (isPlayer())
if (isPlayer() && !_isFlying)
{
// In case of cursor movement, avoid moving through obstacles.
if (_cursorKeyMovement)
@ -5037,37 +5026,31 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
double distFraction;
final double distPassed = (speed * (gameTicks - m._moveTimestamp)) / GameTimeTaskManager.TICKS_PER_SECOND;
if ((((dx * dx) + (dy * dy)) < 10000) && ((dz * dz) > 2500)) // close enough, allows error between client and server geodata if it cannot be avoided
double delta = (dx * dx) + (dy * dy);
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
distFraction = distPassed / Math.sqrt((dx * dx) + (dy * dy));
delta = Math.sqrt(delta);
}
else
{
distFraction = distPassed / Math.sqrt((dx * dx) + (dy * dy) + (dz * dz));
delta = Math.sqrt(delta + (dz * dz));
}
double distFraction = Double.MAX_VALUE;
if (delta > 1)
{
final double distPassed = (_stat.getMoveSpeed() * (gameTicks - m._moveTimestamp)) / GameTimeTaskManager.TICKS_PER_SECOND;
distFraction = distPassed / delta;
}
if (distFraction > 1)
{
// Set the position of the Creature to the destination
super.setXYZ(m._xDestination, m._yDestination, m._zDestination);
if (isBoat())
{
((Boat) this).updatePeopleInTheBoat(m._xDestination, m._yDestination, m._zDestination);
@ -5306,7 +5289,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
final int curZ = getZ();
// Mobius: Fix for teleporting on top of catacomb entrances.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (z > curZ))
{
z = Math.max(z - 500, curZ);

View File

@ -4996,18 +4996,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
double dx = m._xDestination - m._xAccurate;
double dy = m._yDestination - m._yAccurate;
double dz = m._zDestination - zPrev; // Z coordinate will follow client values
float speed;
if (this instanceof Boat)
{
speed = ((Boat) this).boatSpeed;
}
else
{
speed = getStat().getMoveSpeed();
}
if (isPlayer())
if (isPlayer() && !_isFlying)
{
// In case of cursor movement, avoid moving through obstacles.
if (_cursorKeyMovement)
@ -5083,37 +5072,31 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
double distFraction;
final double distPassed = (speed * (gameTicks - m._moveTimestamp)) / GameTimeTaskManager.TICKS_PER_SECOND;
if ((((dx * dx) + (dy * dy)) < 10000) && ((dz * dz) > 2500)) // close enough, allows error between client and server geodata if it cannot be avoided
double delta = (dx * dx) + (dy * dy);
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
distFraction = distPassed / Math.sqrt((dx * dx) + (dy * dy));
delta = Math.sqrt(delta);
}
else
{
distFraction = distPassed / Math.sqrt((dx * dx) + (dy * dy) + (dz * dz));
delta = Math.sqrt(delta + (dz * dz));
}
double distFraction = Double.MAX_VALUE;
if (delta > 1)
{
final double distPassed = (_stat.getMoveSpeed() * (gameTicks - m._moveTimestamp)) / GameTimeTaskManager.TICKS_PER_SECOND;
distFraction = distPassed / delta;
}
if (distFraction > 1)
{
// Set the position of the Creature to the destination
super.setXYZ(m._xDestination, m._yDestination, m._zDestination);
if (isBoat())
{
((Boat) this).updatePeopleInTheBoat(m._xDestination, m._yDestination, m._zDestination);
@ -5352,7 +5335,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
final int curZ = getZ();
// Mobius: Fix for teleporting on top of catacomb entrances.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (z > curZ))
{
z = Math.max(z - 500, curZ);

View File

@ -4059,25 +4059,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -4104,7 +4091,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -4304,7 +4291,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -4250,25 +4250,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -4295,7 +4282,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -4495,7 +4482,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -4252,25 +4252,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -4297,7 +4284,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -4497,7 +4484,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3289,25 +3289,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3334,7 +3321,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3536,7 +3523,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3289,25 +3289,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3334,7 +3321,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3536,7 +3523,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3289,25 +3289,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3334,7 +3321,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3536,7 +3523,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3288,25 +3288,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3333,7 +3320,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3535,7 +3522,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3291,25 +3291,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3336,7 +3323,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3538,7 +3525,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3310,25 +3310,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3355,7 +3342,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3557,7 +3544,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3320,25 +3320,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3365,7 +3352,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3567,7 +3554,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;

View File

@ -3320,25 +3320,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
}
// Prevent player moving on ledges.
if ((dz > 180) && (distance < 300))
{
_move.onGeodataPathIndex = -1;
if (hasAI() && getAI().isFollowing())
{
getAI().stopFollow();
}
stopMove(null);
return false;
}
}
}
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE));
if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided.
{
delta = Math.sqrt(delta);
}
@ -3365,7 +3352,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
m._yAccurate += dy * distFraction;
// Set the position of the Creature to estimated after parcial move
super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5));
super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5));
}
revalidateZone(false);
@ -3567,7 +3554,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000.
final boolean isInWater = isInsideZone(ZoneId.WATER);
final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE);
if (isInWater && (distance > 700))
{
final double divider = 700 / distance;