Skip to content

Commit 8396941

Browse files
committed
bugfix: don't try to produce cliamer in a room that cannot.
1 parent c0827f2 commit 8396941

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
};
@@ -481,7 +483,7 @@ Room.prototype.getCreepConfig = function(creep) {
481483
Room.prototype.spawnCreateCreep = function(creep) {
482484
const spawns = this.findSpawnsNotSpawning();
483485
if (spawns.length === 0) {
484-
return;
486+
return false;
485487
}
486488

487489
const config = this.getCreepConfig(creep);

0 commit comments

Comments
 (0)