diff options
| author | Tom Harley | 2018-06-26 16:21:46 +0100 |
|---|---|---|
| committer | Tom Harley | 2018-06-26 16:21:46 +0100 |
| commit | 19d3d7dbae37c5d863f8887602ef8241ac770551 (patch) | |
| tree | 1b1e63d378e6e0f719c41cc272b7bad23f10d6c1 /src/role.harvester.js | |
| parent | Unify movement commands (diff) | |
| download | screeps-ai-19d3d7dbae37c5d863f8887602ef8241ac770551.tar.gz screeps-ai-19d3d7dbae37c5d863f8887602ef8241ac770551.zip | |
Actually include unified movement function
Diffstat (limited to 'src/role.harvester.js')
| -rw-r--r-- | src/role.harvester.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/role.harvester.js b/src/role.harvester.js index e08db08..126f575 100644 --- a/src/role.harvester.js +++ b/src/role.harvester.js @@ -1,4 +1,4 @@ -const move = require('creep'); +const util = require('creep'); module.exports = { run: (creep) => { @@ -6,12 +6,12 @@ module.exports = { // just use the first source for now const source = creep.pos.findClosestByPath(FIND_SOURCES); if (creep.harvest(source) == ERR_NOT_IN_RANGE) { - move(creep, source); + util.move(creep, source); } } else { const spawn = Game.spawns['Initial']; if (creep.transfer(spawn, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) { - move(creep, spawn); + util.move(creep, spawn); } } } |
