Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
code = creep.moveTo(target, opts);
if (code === ERR_NO_PATH) {
// ignore these. We can't cound blocked, because they re-path after 5 turns.
creep.say(Errors.errorEmoji[ERR_NO_PATH]);
return OK;
}
Errors.check(creep, `moveTo ${target}`, code);
if (code === OK || code === ERR_TIRED) {
creep.busy = 1;
if(code === OK && creep.memory.blocked && --creep.memory.blocked >= 0) {
delete creep.memory.blocked;
}
if (! disableRoadCheck) {
Roads.shouldBuildAt(creep);
}
return OK;
} else if (code === ERR_NO_BODYPART) {
// unable to move?
this.suicide(creep);
}
return code;
}