Smoother movement when exiting vehicle.

This commit is contained in:
MobiusDev
2018-01-23 09:36:38 +00:00
parent 48bd6b84c8
commit ad7fef7d49
6 changed files with 72 additions and 54 deletions

View File

@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
if (!isInVehicle)
{
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
}
// Pathfinding checks.
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)

View File

@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
if (!isInVehicle)
{
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
}
// Pathfinding checks.
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)

View File

@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
if (!isInVehicle)
{
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
}
// Pathfinding checks.
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)

View File

@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
if (!isInVehicle)
{
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
}
// Pathfinding checks.
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)

View File

@@ -4398,15 +4398,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
// 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, getInstanceId());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
if (!isInVehicle)
{
// 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, getInstanceId());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
}
// Pathfinding checks.
if (((originalDistance - distance) > 30) && !isAfraid() && !isInVehicle)

View File

@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
if (!isInVehicle)
{
// 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());
x = destiny.getX();
y = destiny.getY();
z = destiny.getZ();
dx = x - curX;
dy = y - curY;
dz = z - curZ;
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
}
// Pathfinding checks.
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)