fix en error in the planter when path length == 1

This commit is contained in:
Hea3veN 2015-03-28 09:31:39 -03:00
parent a1f195e896
commit e9e7d4b6c6

View file

@ -127,7 +127,9 @@ public class BoardRobotPlanter extends RedstoneBoardRobot {
AIRobotSearchRandomBlock searchAI = (AIRobotSearchRandomBlock) ai;
if (searchAI.takeResource()) {
blockFound = searchAI.blockFound;
searchAI.path.removeLast();
if (searchAI.path.size() > 1){
searchAI.path.removeLast();
}
startDelegateAI(new AIRobotGotoBlock(robot, searchAI.path));
} else {
startDelegateAI(new AIRobotGotoSleep(robot));