summaryrefslogtreecommitdiff
path: root/src/role.upgrader.js
diff options
context:
space:
mode:
authorTom Harley2018-06-26 16:21:46 +0100
committerTom Harley2018-06-26 16:21:46 +0100
commit19d3d7dbae37c5d863f8887602ef8241ac770551 (patch)
tree1b1e63d378e6e0f719c41cc272b7bad23f10d6c1 /src/role.upgrader.js
parentUnify movement commands (diff)
downloadscreeps-ai-19d3d7dbae37c5d863f8887602ef8241ac770551.tar.gz
screeps-ai-19d3d7dbae37c5d863f8887602ef8241ac770551.zip

Actually include unified movement function

Diffstat (limited to 'src/role.upgrader.js')
-rw-r--r--src/role.upgrader.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/role.upgrader.js b/src/role.upgrader.js
index 160b5d5..26ccdf6 100644
--- a/src/role.upgrader.js
+++ b/src/role.upgrader.js
@@ -1,11 +1,11 @@
-const move = require('creep');
+const util = require('creep');
module.exports = {
run: (creep) => {
if (creep.memory.state === "withdrawing") {
const source = Game.spawns['Initial'];
if (creep.withdraw(source, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
- move(creep, source);
+ util.move(creep, source);
}
if (creep.carry.energy == creep.carryCapacity) {
creep.memory.state = "upgrading";
@@ -13,7 +13,7 @@ module.exports = {
} else {
const controller = creep.room.controller;
if (creep.upgradeController(controller) == ERR_NOT_IN_RANGE) {
- move(creep, controller, { range: 3 });
+ util.move(creep, controller, { range: 3 });
}
if (creep.carry.energy == 0) {
creep.memory.state = "withdrawing";