diff --git a/assignsources.js b/assignsources.js index 4698eb5..075251b 100644 --- a/assignsources.js +++ b/assignsources.js @@ -1,6 +1,6 @@ let assignMiners = { tick: function(roomname) { - let sources = Game.rooms[roomname].find(FIND_SOURCES ); + let sources = Game.rooms[roomname].find(FIND_SOURCES); for(let source of sources){ let allminers = Game.rooms[roomname].find(FIND_MY_CREEPS, {filter: (creep) =>{return ( creep.memory.role=='sourceminer'|| creep.memory.role == ("phase" + Game.rooms[roomname].memory.phase + "worker") )}}); //let allstorage = Game.rooms[name].find(FIND_STRUCTURES, {filter: (s) => {return ( s.structureType == STRUCTURE_CONTAINER || s.structureType == STRUCTURE_STORAGE)}}) diff --git a/role.phase0worker.js b/role.phase0worker.js index 266309a..27e17a8 100644 --- a/role.phase0worker.js +++ b/role.phase0worker.js @@ -49,7 +49,7 @@ let Phase0Worker = { 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}); 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) //mysource=creep.pos.findClosestByRange( FIND_SOURCES ) if(creep.harvest(mysource) == ERR_NOT_IN_RANGE){