Mining changes

This commit is contained in:
Dan Hamik 2022-05-16 13:26:51 -05:00
parent 2a94fffaae
commit aa2d7fdfce
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ let Phase0Worker = {
let droppedenergy = creep.pos.findClosestByRange(FIND_DROPPED_RESOURCES, {filter: {resourceType: RESOURCE_ENERGY}}); let droppedenergy = creep.pos.findClosestByRange(FIND_DROPPED_RESOURCES, {filter: {resourceType: RESOURCE_ENERGY}});
let ruins=creep.pos.findClosestByRange(FIND_RUINS, {filter: ruin => ruin.store.getUsedCapacity(RESOURCE_ENERGY) > 0}); let ruins=creep.pos.findClosestByRange(FIND_RUINS, {filter: ruin => ruin.store.getUsedCapacity(RESOURCE_ENERGY) > 0});
if(droppedenergy == undefined && ruins==undefined){ if(droppedenergy == undefined && ruins==undefined){
if(Game.getObjectById(creep.memory.destsource.id)==undefined){creep.memory.destsource=undefined} if((Game.getObjectById(creep.memory.destsource.id)==undefined)){creep.memory.destsource=undefined}
let mysource=Game.getObjectById(creep.memory.destsource.id) let mysource=Game.getObjectById(creep.memory.destsource.id)
//mysource=creep.pos.findClosestByRange( FIND_SOURCES ) //mysource=creep.pos.findClosestByRange( FIND_SOURCES )
if(creep.harvest(mysource) == ERR_NOT_IN_RANGE){ if(creep.harvest(mysource) == ERR_NOT_IN_RANGE){