Smoother movement when exiting vehicle.
This commit is contained in:
@@ -3294,6 +3294,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isInVehicle)
|
||||||
|
{
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
// 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());
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
x = destiny.getX();
|
x = destiny.getX();
|
||||||
@@ -3303,6 +3305,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
dy = y - curY;
|
dy = y - curY;
|
||||||
dz = z - curZ;
|
dz = z - curZ;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
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,6 +3294,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isInVehicle)
|
||||||
|
{
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
// 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());
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
x = destiny.getX();
|
x = destiny.getX();
|
||||||
@@ -3303,6 +3305,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
dy = y - curY;
|
dy = y - curY;
|
||||||
dz = z - curZ;
|
dz = z - curZ;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
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,6 +3294,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isInVehicle)
|
||||||
|
{
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
// 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());
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
x = destiny.getX();
|
x = destiny.getX();
|
||||||
@@ -3303,6 +3305,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
dy = y - curY;
|
dy = y - curY;
|
||||||
dz = z - curZ;
|
dz = z - curZ;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
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,6 +3294,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isInVehicle)
|
||||||
|
{
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
// 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());
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
x = destiny.getX();
|
x = destiny.getX();
|
||||||
@@ -3303,6 +3305,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
dy = y - curY;
|
dy = y - curY;
|
||||||
dz = z - curZ;
|
dz = z - curZ;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
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,6 +4398,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isInVehicle)
|
||||||
|
{
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
// 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());
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId());
|
||||||
x = destiny.getX();
|
x = destiny.getX();
|
||||||
@@ -4407,6 +4409,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
dy = y - curY;
|
dy = y - curY;
|
||||||
dz = z - curZ;
|
dz = z - curZ;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
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,6 +3294,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isInVehicle)
|
||||||
|
{
|
||||||
// location different if destination wasn't reached (or just z coord is different)
|
// 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());
|
final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld());
|
||||||
x = destiny.getX();
|
x = destiny.getX();
|
||||||
@@ -3303,6 +3305,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
dy = y - curY;
|
dy = y - curY;
|
||||||
dz = z - curZ;
|
dz = z - curZ;
|
||||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
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