fix picker robot hanging on unreachable items

This commit is contained in:
Hea3veN 2015-06-05 20:00:48 -03:00
parent 6905b7743a
commit 1f33864dae
3 changed files with 4 additions and 2 deletions

View file

@ -34,3 +34,4 @@ Bugs fixed:
* Fix some robots not going to sleep if they fail to equip items (hea3ven) * Fix some robots not going to sleep if they fail to equip items (hea3ven)
* Fix rendering issues with pipe contents after a texture reload (asie) * Fix rendering issues with pipe contents after a texture reload (asie)
* Fix crash upon new config file generation (asie) * Fix crash upon new config file generation (asie)
* Fix picker robot hanging on unreachable items (hea3ven)

View file

@ -84,6 +84,7 @@ public class AIRobotFetchItem extends AIRobot {
if (!ai.success()) { if (!ai.success()) {
robot.unreachableEntityDetected(target); robot.unreachableEntityDetected(target);
setSuccess(false);
terminate(); terminate();
} }
} }

View file

@ -65,9 +65,9 @@ public class AIRobotGotoBlock extends AIRobotGoto {
if (path == null && pathSearch == null) { if (path == null && pathSearch == null) {
pathSearch = new PathFinding(robot.worldObj, new BlockIndex((int) Math.floor(robot.posX), pathSearch = new PathFinding(robot.worldObj, new BlockIndex((int) Math.floor(robot.posX),
(int) Math.floor(robot.posY), (int) Math.floor(robot.posZ)), new BlockIndex( (int) Math.floor(robot.posY), (int) Math.floor(robot.posZ)), new BlockIndex(
(int) Math.floor(finalX), (int) Math.floor(finalY), (int) Math.floor(finalZ)), maxDistance); (int) Math.floor(finalX), (int) Math.floor(finalY), (int) Math.floor(finalZ)), maxDistance, 96);
pathSearchJob = new IterableAlgorithmRunner(pathSearch, 100); pathSearchJob = new IterableAlgorithmRunner(pathSearch, 50);
pathSearchJob.start(); pathSearchJob.start();
} else if (path != null) { } else if (path != null) {
double distance = robot.getDistance(nextX, nextY, nextZ); double distance = robot.getDistance(nextX, nextY, nextZ);