Skip to content

Commit

Permalink
fix: Remove evacuating flag from rooms we abandon.
Browse files Browse the repository at this point in the history
Otherwise they will still be in evacuation mode if they ever get reclaimed.
  • Loading branch information
Mirroar committed Apr 30, 2024
1 parent 443740e commit 93a4659
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/process/strategy/expand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,13 @@ export default class ExpandProcess extends Process {
if (droppedResources?.length > 0) return;

// Alright, this is it, flipping the switch!
room.controller.unclaim();
_.each(
_.filter(room.find(FIND_MY_CREEPS), creep => creep.memory.singleRoom === room.name),
creep => creep.suicide(),
);
if (room.controller.unclaim() === OK) {
room.setEvacuating(false);
_.each(
_.filter(room.find(FIND_MY_CREEPS), creep => creep.memory.singleRoom === room.name),
creep => creep.suicide(),
);
}
}

private cleanupMemory() {
Expand Down

0 comments on commit 93a4659

Please sign in to comment.