Skip to content

Commit 60a24f3

Browse files
committed
bugfix: don't try to produce cliamer in a room that cannot.
1 parent 9233bf0 commit 60a24f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/prototype_room_creepbuilder.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Room.prototype.spawnCheckForCreate = function() {
5757
creep.ttl = creep.ttl || config.creep.queueTtl;
5858
if (this.findSpawnsNotSpawning().length === 0) {
5959
creep.ttl--;
60+
} else if (this.energyAvailable === this.energyCapacityAvailable) {
61+
creep.ttl = 0;
6062
}
6163
return false;
6264
};
@@ -476,7 +478,7 @@ Room.prototype.getCreepConfig = function(creep) {
476478
Room.prototype.spawnCreateCreep = function(creep) {
477479
const spawns = this.findSpawnsNotSpawning();
478480
if (spawns.length === 0) {
479-
return;
481+
return false;
480482
}
481483

482484
const config = this.getCreepConfig(creep);

0 commit comments

Comments
 (0)