Smoother movement when exiting vehicle.
This commit is contained in:
@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
if (!isInVehicle)
|
||||||
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
{
|
||||||
x = destiny.getX();
|
// location different if destination wasn't reached (or just z coord is different)
|
||||||
y = destiny.getY();
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
z = destiny.getZ();
|
x = destiny.getX();
|
||||||
dx = x - curX;
|
y = destiny.getY();
|
||||||
dy = y - curY;
|
z = destiny.getZ();
|
||||||
dz = z - curZ;
|
dx = x - curX;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
dy = y - curY;
|
||||||
|
dz = z - curZ;
|
||||||
|
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
// Pathfinding checks.
|
// Pathfinding checks.
|
||||||
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
||||||
|
@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
if (!isInVehicle)
|
||||||
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
{
|
||||||
x = destiny.getX();
|
// location different if destination wasn't reached (or just z coord is different)
|
||||||
y = destiny.getY();
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
z = destiny.getZ();
|
x = destiny.getX();
|
||||||
dx = x - curX;
|
y = destiny.getY();
|
||||||
dy = y - curY;
|
z = destiny.getZ();
|
||||||
dz = z - curZ;
|
dx = x - curX;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
dy = y - curY;
|
||||||
|
dz = z - curZ;
|
||||||
|
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
// Pathfinding checks.
|
// Pathfinding checks.
|
||||||
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
||||||
|
@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
if (!isInVehicle)
|
||||||
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
{
|
||||||
x = destiny.getX();
|
// location different if destination wasn't reached (or just z coord is different)
|
||||||
y = destiny.getY();
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
z = destiny.getZ();
|
x = destiny.getX();
|
||||||
dx = x - curX;
|
y = destiny.getY();
|
||||||
dy = y - curY;
|
z = destiny.getZ();
|
||||||
dz = z - curZ;
|
dx = x - curX;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
dy = y - curY;
|
||||||
|
dz = z - curZ;
|
||||||
|
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
// Pathfinding checks.
|
// Pathfinding checks.
|
||||||
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
||||||
|
@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
if (!isInVehicle)
|
||||||
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
{
|
||||||
x = destiny.getX();
|
// location different if destination wasn't reached (or just z coord is different)
|
||||||
y = destiny.getY();
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
z = destiny.getZ();
|
x = destiny.getX();
|
||||||
dx = x - curX;
|
y = destiny.getY();
|
||||||
dy = y - curY;
|
z = destiny.getZ();
|
||||||
dz = z - curZ;
|
dx = x - curX;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
dy = y - curY;
|
||||||
|
dz = z - curZ;
|
||||||
|
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
// Pathfinding checks.
|
// Pathfinding checks.
|
||||||
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
||||||
|
@@ -4398,15 +4398,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
if (!isInVehicle)
|
||||||
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId());
|
{
|
||||||
x = destiny.getX();
|
// location different if destination wasn't reached (or just z coord is different)
|
||||||
y = destiny.getY();
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId());
|
||||||
z = destiny.getZ();
|
x = destiny.getX();
|
||||||
dx = x - curX;
|
y = destiny.getY();
|
||||||
dy = y - curY;
|
z = destiny.getZ();
|
||||||
dz = z - curZ;
|
dx = x - curX;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
dy = y - curY;
|
||||||
|
dz = z - curZ;
|
||||||
|
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
// Pathfinding checks.
|
// Pathfinding checks.
|
||||||
if (((originalDistance - distance) > 30) && !isAfraid() && !isInVehicle)
|
if (((originalDistance - distance) > 30) && !isAfraid() && !isInVehicle)
|
||||||
|
@@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
if (!isInVehicle)
|
||||||
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
{
|
||||||
x = destiny.getX();
|
// location different if destination wasn't reached (or just z coord is different)
|
||||||
y = destiny.getY();
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
z = destiny.getZ();
|
x = destiny.getX();
|
||||||
dx = x - curX;
|
y = destiny.getY();
|
||||||
dy = y - curY;
|
z = destiny.getZ();
|
||||||
dz = z - curZ;
|
dx = x - curX;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
dy = y - curY;
|
||||||
|
dz = z - curZ;
|
||||||
|
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
||||||
|
}
|
||||||
|
|
||||||
// Pathfinding checks.
|
// Pathfinding checks.
|
||||||
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
||||||
|
Reference in New Issue
Block a user