summaryrefslogtreecommitdiff
path: root/src/role.builder.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/role.builder.js')
-rw-r--r--src/role.builder.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/role.builder.js b/src/role.builder.js
index a4fc27f..8c7fc6b 100644
--- a/src/role.builder.js
+++ b/src/role.builder.js
@@ -1,3 +1,5 @@
+const util = require('creep');
+
module.exports = {
run: (creep) => {
if (creep.memory.state === "building") {
@@ -5,7 +7,7 @@ module.exports = {
const targets = creep.room.find(FIND_CONSTRUCTION_SITES);
if (targets.length) {
if (creep.build(targets[0]) == ERR_NOT_IN_RANGE) {
- move(creep, targets[0]);
+ util.move(creep, targets[0]);
}
}
} else {
@@ -16,7 +18,7 @@ module.exports = {
// still filling up
const spawn = Game.spawns['Initial'];
if (creep.transfer(spawn, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
- move(creep, spawn);
+ util.move(creep, spawn);
}
} else {
creep.memory.state = "building";