Removed unused boolean parameter.

This commit is contained in:
MobiusDev 2017-08-27 19:01:23 +00:00
parent a5ab4d03d4
commit bbf9bb1789
22 changed files with 83 additions and 89 deletions

View File

@ -38,7 +38,7 @@ public class AdminPathNode implements IAdminCommandHandler
{
if (activeChar.getTarget() != null)
{
List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld(), true);
final List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld());
if (path == null)
{
activeChar.sendMessage("No route found or pathfinding disabled.");

View File

@ -1288,10 +1288,9 @@ public class GeoEngine
* @param ty : target y
* @param tz : target z
* @param instance
* @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, Instance instance, boolean playable)
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance)
{
return null;
}

View File

@ -65,7 +65,7 @@ final class GeoEnginePathfinding extends GeoEngine
}
@Override
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance, boolean playable)
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance)
{
// get origin and check existing geo coords
int gox = getGeoX(ox);
@ -88,7 +88,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;
@ -213,10 +213,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)

View File

@ -3521,15 +3521,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
distance = Math.hypot(dx, dy);
}
// @formatter:off
// Define movement angles needed
// ^
// | X (x,y)
// | /
// | /distance
// | / distance
// | /
// |/ angle
// X ---------->
// (curx,cury)
// @formatter:on
double cos;
double sin;
@ -3643,13 +3645,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
dz = z - curZ;
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
// Pathfinding checks. Only when geodata setting is 2, the LoS check gives shorter result
// This way of detecting need for pathfinding could be changed.
if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
{
// Path calculation -- overrides previous movement check
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayable());
if ((m.geoPath == null) || (m.geoPath.size() < 2))
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found
{
// 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.
@ -3735,9 +3737,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
// to destination by GameTimeController
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive to destination by GameTimeController
}
public boolean moveToNextRoutePoint()

View File

@ -38,7 +38,7 @@ public class AdminPathNode implements IAdminCommandHandler
{
if (activeChar.getTarget() != null)
{
List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld(), true);
final List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld());
if (path == null)
{
activeChar.sendMessage("No route found or pathfinding disabled.");

View File

@ -1288,10 +1288,9 @@ public class GeoEngine
* @param ty : target y
* @param tz : target z
* @param instance
* @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, Instance instance, boolean playable)
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance)
{
return null;
}

View File

@ -65,7 +65,7 @@ final class GeoEnginePathfinding extends GeoEngine
}
@Override
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance, boolean playable)
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance)
{
// get origin and check existing geo coords
int gox = getGeoX(ox);
@ -88,7 +88,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;
@ -213,10 +213,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)

View File

@ -3521,15 +3521,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
distance = Math.hypot(dx, dy);
}
// @formatter:off
// Define movement angles needed
// ^
// | X (x,y)
// | /
// | /distance
// | / distance
// | /
// |/ angle
// X ---------->
// (curx,cury)
// @formatter:on
double cos;
double sin;
@ -3643,13 +3645,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
dz = z - curZ;
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
// Pathfinding checks. Only when geodata setting is 2, the LoS check gives shorter result
// This way of detecting need for pathfinding could be changed.
if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
{
// Path calculation -- overrides previous movement check
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayable());
if ((m.geoPath == null) || (m.geoPath.size() < 2))
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found
{
// 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.
@ -3735,9 +3737,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
// to destination by GameTimeController
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive to destination by GameTimeController
}
public boolean moveToNextRoutePoint()

View File

@ -38,7 +38,7 @@ public class AdminPathNode implements IAdminCommandHandler
{
if (activeChar.getTarget() != null)
{
List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld(), true);
final List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld());
if (path == null)
{
activeChar.sendMessage("No route found or pathfinding disabled.");

View File

@ -1288,10 +1288,9 @@ public class GeoEngine
* @param ty : target y
* @param tz : target z
* @param instance
* @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, Instance instance, boolean playable)
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance)
{
return null;
}

View File

@ -65,7 +65,7 @@ final class GeoEnginePathfinding extends GeoEngine
}
@Override
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance, boolean playable)
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance)
{
// get origin and check existing geo coords
int gox = getGeoX(ox);
@ -88,7 +88,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;
@ -213,10 +213,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)

View File

@ -3521,15 +3521,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
distance = Math.hypot(dx, dy);
}
// @formatter:off
// Define movement angles needed
// ^
// | X (x,y)
// | /
// | /distance
// | / distance
// | /
// |/ angle
// X ---------->
// (curx,cury)
// @formatter:on
double cos;
double sin;
@ -3643,13 +3645,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
dz = z - curZ;
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
// Pathfinding checks. Only when geodata setting is 2, the LoS check gives shorter result
// This way of detecting need for pathfinding could be changed.
if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
{
// Path calculation -- overrides previous movement check
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayable());
if ((m.geoPath == null) || (m.geoPath.size() < 2))
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found
{
// 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.
@ -3735,9 +3737,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
// to destination by GameTimeController
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive to destination by GameTimeController
}
public boolean moveToNextRoutePoint()

View File

@ -38,7 +38,7 @@ public class AdminPathNode implements IAdminCommandHandler
{
if (activeChar.getTarget() != null)
{
List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceId(), true);
List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceId());
if (path == null)
{
activeChar.sendMessage("No route found or pathfinding disabled.");

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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)

View File

@ -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()))

View File

@ -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;

View File

@ -38,7 +38,7 @@ public class AdminPathNode implements IAdminCommandHandler
{
if (activeChar.getTarget() != null)
{
List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld(), true);
final List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld());
if (path == null)
{
activeChar.sendMessage("No route found or pathfinding disabled.");

View File

@ -1288,10 +1288,9 @@ public class GeoEngine
* @param ty : target y
* @param tz : target z
* @param instance
* @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, Instance instance, boolean playable)
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance)
{
return null;
}

View File

@ -65,7 +65,7 @@ final class GeoEnginePathfinding extends GeoEngine
}
@Override
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance, boolean playable)
public List<Location> findPath(int ox, int oy, int oz, int tx, int ty, int tz, Instance instance)
{
// get origin and check existing geo coords
int gox = getGeoX(ox);
@ -88,7 +88,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;
@ -213,10 +213,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)

View File

@ -3521,15 +3521,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
distance = Math.hypot(dx, dy);
}
// @formatter:off
// Define movement angles needed
// ^
// | X (x,y)
// | /
// | /distance
// | / distance
// | /
// |/ angle
// X ---------->
// (curx,cury)
// @formatter:on
double cos;
double sin;
@ -3643,13 +3645,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
dz = z - curZ;
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
// Pathfinding checks. Only when geodata setting is 2, the LoS check gives shorter result
// This way of detecting need for pathfinding could be changed.
if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
{
// Path calculation -- overrides previous movement check
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld(), isPlayable());
if ((m.geoPath == null) || (m.geoPath.size() < 2))
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found
{
// 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.
@ -3735,9 +3737,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
// to destination by GameTimeController
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive to destination by GameTimeController
}
public boolean moveToNextRoutePoint()