diff --git a/util_energy.js b/util_energy.js index b627119..7e24085 100644 --- a/util_energy.js +++ b/util_energy.js @@ -5,7 +5,7 @@ var energyUtils = { gatherEnergy : function(creep) { let storage; if(creep.room.memory.containers > 0){ - storage = creep.room.findClosestByRange(FIND_STRUCTURES, { + storage = creep.pos.findClosestByRange(FIND_STRUCTURES, { filter: (structure) => { return (structure.structureType == STRUCTURE_CONTAINER) && structure.store.getUsedCapacity(RESOURCE_ENERGY) > 0;