Removed unused boolean parameter.
This commit is contained in:
@@ -50,7 +50,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
@Override
|
||||
protected void onIntentionAttack(L2Character target)
|
||||
{
|
||||
if (Config.PATHFINDING && (GeoEngine.getInstance().findPath(_actor.getX(), _actor.getY(), _actor.getZ(), target.getX(), target.getY(), target.getZ(), _actor.getInstanceId(), true) == null))
|
||||
if (Config.PATHFINDING && (GeoEngine.getInstance().findPath(_actor.getX(), _actor.getY(), _actor.getZ(), target.getX(), target.getY(), target.getZ(), _actor.getInstanceId()) == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -1271,10 +1271,9 @@ public class GeoEngine
|
||||
* @param ty : target y
|
||||
* @param tz : target z
|
||||
* @param instanceId
|
||||
* @param playable : moving object is playable?
|
||||
* @return {@code List<Location>} : complete path from nodes
|
||||
*/
|
||||
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, int instanceId, boolean playable)
|
||||
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, int instanceId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ final class GeoEnginePathfinding extends GeoEngine
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, int instance, boolean playable)
|
||||
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, int instance)
|
||||
{
|
||||
// get origin and check existing geo coords
|
||||
int gox = getGeoX(ox);
|
||||
@@ -87,7 +87,7 @@ final class GeoEnginePathfinding extends GeoEngine
|
||||
short gtz = getHeightNearest(gtx, gty, tz);
|
||||
|
||||
// Prepare buffer for pathfinding calculations
|
||||
NodeBuffer buffer = getBuffer(64 + (2 * Math.max(Math.abs(gox - gtx), Math.abs(goy - gty))), playable);
|
||||
final NodeBuffer buffer = getBuffer(64 + (2 * Math.max(Math.abs(gox - gtx), Math.abs(goy - gty))));
|
||||
if (buffer == null)
|
||||
{
|
||||
return null;
|
||||
@@ -212,10 +212,9 @@ final class GeoEnginePathfinding extends GeoEngine
|
||||
/**
|
||||
* Provides optimize selection of the buffer. When all pre-initialized buffer are locked, creates new buffer.
|
||||
* @param size : pre-calculated minimal required size
|
||||
* @param playable : moving object is playable?
|
||||
* @return NodeBuffer : buffer
|
||||
*/
|
||||
private final NodeBuffer getBuffer(int size, boolean playable)
|
||||
private final NodeBuffer getBuffer(int size)
|
||||
{
|
||||
NodeBuffer current = null;
|
||||
for (BufferHolder holder : _buffers)
|
||||
|
@@ -4274,6 +4274,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
public void moveToLocation(int x, int y, int z, int offset)
|
||||
{
|
||||
// Do not move while character is attacking or casting.
|
||||
// Fixes player attack glitch while target is moving.
|
||||
if (isAttackingNow() || isCastingNow())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the Move Speed of the L2Charcater
|
||||
final double speed = getMoveSpeed();
|
||||
if ((speed <= 0) || isMovementDisabled())
|
||||
@@ -4282,9 +4289,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Get current position of the L2Character
|
||||
final int curX = super.getX();
|
||||
final int curY = super.getY();
|
||||
final int curZ = super.getZ();
|
||||
final int curX = getX();
|
||||
final int curY = getY();
|
||||
final int curZ = getZ();
|
||||
|
||||
// Calculate distance (dx,dy) between current position and destination
|
||||
// TODO: improve Z axis move/follow support when dx,dy are small compared to dz
|
||||
@@ -4344,9 +4351,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
// Notify the AI that the L2Character is arrived at destination
|
||||
getAI().notifyEvent(CtrlEvent.EVT_ARRIVED);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate movement angles needed
|
||||
sin = dy / distance;
|
||||
cos = dx / distance;
|
||||
@@ -4389,9 +4396,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
final int gty = (originalY - L2World.MAP_MIN_Y) >> 4;
|
||||
|
||||
// Movement checks:
|
||||
// When pathfinding enabled, for all characters except monsters returning home (could be changed later to teleport if pathfinding fails)
|
||||
// when geodata == 2, for all characters except mobs returning home (could be changed later to teleport if pathfinding fails)
|
||||
// when geodata == 1, for l2playableinstance
|
||||
// assuming intention_follow only when following owner
|
||||
if ((Config.PATHFINDING && (!(isAttackable() && ((L2Attackable) this).isReturningToSpawnPoint()))) //
|
||||
|| (isPlayer() && !(isInVehicle && (distance > 1500))) //
|
||||
|| (this instanceof L2RiftInvaderInstance))
|
||||
{
|
||||
if (isOnGeodataPath())
|
||||
@@ -4440,20 +4448,16 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
|
||||
}
|
||||
// Pathfinding checks. Only when geodata setting is 2, the LoS check gives shorter result
|
||||
// than the original movement was and the LoS gives a shorter distance than 2000
|
||||
// This way of detecting need for pathfinding could be changed.
|
||||
if (Config.PATHFINDING && ((originalDistance - distance) > 30))
|
||||
if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isInVehicle)
|
||||
{
|
||||
// Path calculation
|
||||
// Overrides previous movement check
|
||||
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayable());
|
||||
// Path calculation -- overrides previous movement check
|
||||
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId());
|
||||
if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found
|
||||
{
|
||||
// Even though there's no path found (remember geonodes aren't perfect),
|
||||
// the mob is attacking and right now we set it so that the mob will go
|
||||
// after target anyway, is dz is small enough.
|
||||
// With cellpathfinding this approach could be changed but would require taking
|
||||
// off the geonodes and some more checks.
|
||||
// No path found
|
||||
// Even though there's no path found (remember geonodes aren't perfect), the mob is attacking and right now we set it so that the mob will go after target anyway, is dz is small enough.
|
||||
// With cellpathfinding this approach could be changed but would require taking off the geonodes and some more checks.
|
||||
// Summons will follow their masters no matter what.
|
||||
// Currently minions also must move freely since L2AttackableAI commands them to move along with their leader
|
||||
if (isPlayer() || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((L2Summon) this).getFollowStatus()))
|
||||
|
@@ -660,7 +660,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((this != target) && skill.isPhysical() && Config.PATHFINDING && (GeoEngine.getInstance().findPath(getX(), getY(), getZ(), target.getX(), target.getY(), target.getZ(), getInstanceId(), true) == null))
|
||||
if ((this != target) && skill.isPhysical() && Config.PATHFINDING && (GeoEngine.getInstance().findPath(getX(), getY(), getZ(), target.getX(), target.getY(), target.getZ(), getInstanceId()) == null))
|
||||
{
|
||||
sendPacket(SystemMessageId.CANNOT_SEE_TARGET);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user