Do not correct destination when player wants to fall.

This commit is contained in:
MobiusDev
2018-09-03 04:24:02 +00:00
parent 9fda26b387
commit db1002ac14
8 changed files with 41 additions and 33 deletions

View File

@ -2444,7 +2444,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* <li>_xDestination, _yDestination, _zDestination : Position of the destination</li>
* <li>_xMoveFrom, _yMoveFrom, _zMoveFrom : Position of the origin</li>
* <li>_moveStartTime : Start time of the movement</li>
* <li>_ticksToMove : Nb of ticks between the start and the destination</li>
* <li>_ticksToMove : Number of ticks between the start and the destination</li>
* <li>_xSpeedTicks, _ySpeedTicks : Speed in unit/ticks</li>
* </ul>
*/
@ -3280,7 +3280,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
if (!isInVehicle)
if (!isInVehicle // Not in vehicle.
&& !(((curZ - z) > 300) && (distance < 300))) // Character wants to fall.
{
// location different if destination wasn't reached (or just z coord is different)
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
@ -3360,7 +3361,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
distance = Math.hypot(distance, dz);
}
// Caclulate the Nb of ticks between the current position and the destination
// Calculate the number of ticks between the current position and the destination
// One tick added for rounding reasons
final int ticksToMove = 1 + (int) ((GameTimeController.TICKS_PER_SECOND * distance) / speed);
m._xDestination = x;
@ -3451,7 +3452,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(curX, curY, m._xDestination, m._yDestination));
}
// Caclulate the Nb of ticks between the current position and the destination
// Calculate the number of ticks between the current position and the destination
// One tick added for rounding reasons
final int ticksToMove = 1 + (int) ((GameTimeController.TICKS_PER_SECOND * distance) / speed);