various minor fixes

This commit is contained in:
SpaceToad 2014-08-17 14:18:37 +02:00
parent 73198c4a7b
commit d70184c3ae
4 changed files with 19 additions and 4 deletions

View file

@ -66,6 +66,11 @@ public class AIRobotCraftWorkbench extends AIRobotCraftGeneric {
@Override
public void update() {
if (recipe == null) {
// loading error
terminate();
return;
}
// [1] look for a crafting order
// -- if none, clear temporary item blacklist and sleep

View file

@ -46,8 +46,12 @@ public class AIRobotGotoRandomGroundBlock extends AIRobot {
} else {
if (!pathFindingJob.isAlive()) {
LinkedList<BlockIndex> path = pathFinding.getResult();
path.removeLast();
startDelegateAI(new AIRobotGotoBlock(robot, path));
if (path.size() == 0) {
terminate();
} else {
path.removeLast();
startDelegateAI(new AIRobotGotoBlock(robot, path));
}
}
}
}

View file

@ -49,6 +49,12 @@ public class AIRobotLoad extends AIRobot {
@Override
public void update() {
if (filter == null) {
// loading error
terminate();
return;
}
waitedCycles++;
if (waitedCycles > 40) {

View file

@ -100,7 +100,7 @@ public class DockingStation implements IDockingStation {
}
public boolean takeAsMain(EntityRobotBase robot) {
if (robotTaking == null) {
if (robotTakingId == EntityRobotBase.NULL_ROBOT_ID) {
linkIsMain = true;
robotTaking = robot;
robotTakingId = robot.getRobotId();
@ -111,7 +111,7 @@ public class DockingStation implements IDockingStation {
return true;
} else {
return false;
return robotTakingId == robot.getRobotId();
}
}