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

@@ -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
// | X (x,y)
// | /
// | / 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()