Skip to content

Commit 3024c95

Browse files
committed
fix: Don't flee from source keepers. We usually path around them if necessary.
1 parent f029c00 commit 3024c95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/creep/combat-manager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export default class CombatManager {
156156

157157
public needsToFlee(creep: Creep): boolean {
158158
const enemyCreeps = this.getEnemyMilitaryCreeps(creep.room);
159-
return this.hasEnemyCreepsInFightingRange(creep, enemyCreeps);
159+
if (!this.hasEnemyCreepsInFightingRange(creep, enemyCreeps)) return false;
160+
161+
return _.some(enemyCreeps, c => c.owner.username !== 'Source Keeper' && !this.couldWinFightAgainst(creep, c));
160162
}
161163

162164
public performKitingMovement(creep: Creep, target: AttackTarget) {

0 commit comments

Comments
 (0)