Changed miner movement;

This commit is contained in:
unknown
2023-08-31 19:13:22 +02:00
parent 8d67dcb8b8
commit bde8a2309f
3 changed files with 4 additions and 7 deletions

View File

@@ -55,7 +55,7 @@ function energyEmptyCheck(creep){
function findEnergyTarget(creep){
var target;
if(creep.room.storage.store.getUsedCapacity(RESOURCE_ENERGY) > creep.store.getFreeCapacity(RESOURCE_ENERGY))
if(creep.room.storage && creep.room.storage.store.getUsedCapacity(RESOURCE_ENERGY) > creep.store.getFreeCapacity(RESOURCE_ENERGY))
target = creep.room.storage;
if(!target) target = creep.pos.findClosestByRange(FIND_STRUCTURES, {
filter: (st)=>{