From eb2b78c9013411fd1b309efc98f286291f3a8b42 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 12 Oct 2020 14:22:23 +0200 Subject: [PATCH] Fix vacatePos (AnyZerg move logic error) & Fix autoRun() (return instead of continue) - causing a role to stop working in a colony if one creep of it's sort is spawning --- src/movement/Movement.ts | 1 - src/overlords/CombatOverlord.ts | 2 +- src/zerg/AnyZerg.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/movement/Movement.ts b/src/movement/Movement.ts index d2a91090d..a6a138be7 100644 --- a/src/movement/Movement.ts +++ b/src/movement/Movement.ts @@ -562,7 +562,6 @@ export class Movement { } - // TODO: this is bugged somewhere /** * Recursively moves creeps out of the way of a position to make room for something, such as a spawning creep. * If suicide is specified and there is no series of move commands that can move a block of creeps out of the way, diff --git a/src/overlords/CombatOverlord.ts b/src/overlords/CombatOverlord.ts index 0425bc947..c4260bd33 100644 --- a/src/overlords/CombatOverlord.ts +++ b/src/overlords/CombatOverlord.ts @@ -42,7 +42,7 @@ export abstract class CombatOverlord extends Overlord { autoRun(roleCreeps: CombatZerg[], creepHandler: (creep: CombatZerg) => void) { for (const creep of roleCreeps) { if (creep.spawning) { - return; + continue; } if (creep.hasValidTask) { creep.run(); diff --git a/src/zerg/AnyZerg.ts b/src/zerg/AnyZerg.ts index bbb491a09..290b590b7 100644 --- a/src/zerg/AnyZerg.ts +++ b/src/zerg/AnyZerg.ts @@ -209,7 +209,7 @@ export abstract class AnyZerg { } move(direction: DirectionConstant, force = false) { - if (!this.blockMovement && !force) { + if (!this.blockMovement || force) { const result = this.creep.move(direction); if (result == OK) { if (!this.actionLog.move) this.actionLog.move = true;