Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!creep.busy) { // Upgrader, also the catch-all
roleUpgrader.run(creep);
}
if (creep.ticksToLive === 1) {
creep.say('☠️ dying');
// console.log(`${creep} ${creep.pos} died naturally.`);
for(const resourceType in creep.carry) {
creep.drop(resourceType);
}
// TODO Inform a Spawner to replace the creep.
delete Memory.creeps[creep.name];
}
}
utils.gc(); // garbage collect the recently deseased creep
Roads.gc();
Towers.gc();
Extensions.gc();
RoomUtils.gc();
BuildOrders.gc();
};