Using geodata checks with fear when pathfinding is enabled.

This commit is contained in:
MobiusDev
2015-10-03 20:55:22 +00:00
parent 017ae105bd
commit de3a25474f

View File

@@ -973,16 +973,15 @@ public class L2CharacterAI extends AbstractAI
_actor.setRunning(); _actor.setRunning();
} }
// If pathfinding enabled the creature will go to the defined destination (retail like). // If pathfinding enabled the creature will go to the nearest obstacle.
// Otherwise it will go to the nearest obstacle.
final Location destination; final Location destination;
if (Config.PATHFINDING > 0) if (Config.PATHFINDING > 0)
{ {
destination = new Location(posX, posY, posZ, _actor.getInstanceId()); destination = GeoData.getInstance().moveCheck(_actor.getX(), _actor.getY(), _actor.getZ(), posX, posY, posZ, _actor.getInstanceId());
} }
else else
{ {
destination = GeoData.getInstance().moveCheck(_actor.getX(), _actor.getY(), _actor.getZ(), posX, posY, posZ, _actor.getInstanceId()); destination = new Location(posX, posY, posZ);
} }
setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination); setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
} }