Improved performance of walking.
Switches to manual walking when close to target.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
const { round } = require("lodash");
|
||||
|
||||
module.exports = {
|
||||
// Gets called when recompiling and when Restart command is called.
|
||||
start: function () {
|
||||
@@ -11,7 +13,10 @@ module.exports = {
|
||||
update: function () {
|
||||
for (const creep_name in Memory.creeps) {
|
||||
const creep = Game.creeps[creep_name];
|
||||
if (creep == undefined) delete Memory.creeps[creep_name];
|
||||
if (creep == undefined) {
|
||||
delete Memory.creeps[creep_name];
|
||||
return;
|
||||
}
|
||||
switch (creep.memory.role) {
|
||||
case ROLE_HARVESTER:
|
||||
if (creep.memory.recharge) creep.harvestSource();
|
||||
|
||||
Reference in New Issue
Block a user