From 19d3d7dbae37c5d863f8887602ef8241ac770551 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Tue, 26 Jun 2018 16:21:46 +0100 Subject: Actually include unified movement function --- src/role.builder.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/role.builder.js') 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"; -- cgit v1.2.1