From 9cd8f77f365b75c76f3acb44858b4894b6b41eaa Mon Sep 17 00:00:00 2001 From: paradizelost Date: Thu, 15 Sep 2016 02:07:39 -0500 Subject: [PATCH] Fixed edge case in logic that caused creeps to just sit there --- role.hauler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/role.hauler.js b/role.hauler.js index 55a597b..f0cadae 100644 --- a/role.hauler.js +++ b/role.hauler.js @@ -11,14 +11,14 @@ var roleHauler = { } var sources = creep.room.find(FIND_DROPPED_ENERGY ); if(creep.memory.hauling==false){ - if(creep.pickup(sources[0]) == ERR_NOT_IN_RANGE && creep.carryCapacity/2 > creep.carry.energy) { + if(creep.pickup(sources[0]) == ERR_NOT_IN_RANGE && creep.carryCapacity > creep.carry.energy) { creep.moveTo(sources[0]); } }else { if(sources != undefined ) { var spawntargets = creep.room.find(FIND_STRUCTURES, { filter: (structure) => { - return ((structure.structureType == STRUCTURE_EXTENSION || structure.structureType == STRUCTURE_SPAWN) &&structure.energy < structure.energyCapacity) + return ((structure.structureType == STRUCTURE_EXTENSION || structure.structureType == STRUCTURE_SPAWN) && structure.energy < structure.energyCapacity) } }); var containertargets = creep.room.find(FIND_STRUCTURES, {