summaryrefslogtreecommitdiff
path: root/src/role.harvester.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/role.harvester.js')
-rw-r--r--src/role.harvester.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/role.harvester.js b/src/role.harvester.js
index 31e05d1..5c6f85c 100644
--- a/src/role.harvester.js
+++ b/src/role.harvester.js
@@ -1,3 +1,5 @@
+// vim: tw=80 ts=2 sw=2 et
+
const util = require('creep');
module.exports = {
@@ -5,7 +7,7 @@ module.exports = {
if (creep.carry.energy < creep.carryCapacity) {
const source = creep.pos.findClosestByPath(FIND_SOURCES);
if (creep.harvest(source) == ERR_NOT_IN_RANGE) {
- util.move(creep, source);
+ creep.moveTo(source);
}
} else {
const spawn = creep.pos.findClosestByPath(FIND_MY_STRUCTURES, {
@@ -16,7 +18,7 @@ module.exports = {
}
});
if (creep.transfer(spawn, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
- util.move(creep, spawn);
+ creep.moveTo(spawn);
}
}
}