From afd1bf51818057652f3e08f9ae57a34155d67d78 Mon Sep 17 00:00:00 2001 From: Fernando Jorge Date: Mon, 26 Dec 2022 22:58:25 -0300 Subject: [PATCH] Improving creep efficiency on bringing energy to the room controller --- section2/role.upgrader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/section2/role.upgrader.js b/section2/role.upgrader.js index 9b406b2..e07fd43 100644 --- a/section2/role.upgrader.js +++ b/section2/role.upgrader.js @@ -2,7 +2,7 @@ var roleUpgrader = { /** @param {Creep} creep **/ run: function(creep) { - if(creep.store[RESOURCE_ENERGY] == 0) { + if(creep.store[RESOURCE_ENERGY] < 50) { var sources = creep.room.find(FIND_SOURCES); if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) { creep.moveTo(sources[0]);