Skip to content

Commit 484d3b9

Browse files
committed
idle harvesters go to container instead of source
1 parent 271c115 commit 484d3b9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

role.harvester.js

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ var roleHarvester = {
2121
if(creep.transfer(targets[0], RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
2222
creep.moveTo(targets[0], {visualizePathStyle: {stroke: '#ffffff'}});
2323
}
24+
}else{
25+
var targets = creep.room.find(FIND_STRUCTURES, {
26+
filter: (structure) => {
27+
return (structure.structureType == STRUCTURE_EXTENSION ||
28+
structure.structureType == STRUCTURE_SPAWN ||
29+
structure.structureType == STRUCTURE_TOWER);
30+
}
31+
});
32+
creep.moveTo(targets[0], {visualizePathStyle: {stroke: '#ffffff'}});
2433
}
2534
}
2635
},

0 commit comments

Comments
 (0)