Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: don't try to produce cliamer in a room that cannot. #695

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/prototype_room_creepbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Room.prototype.spawnCheckForCreate = function() {
creep.ttl = creep.ttl || config.creep.queueTtl;
if (this.findSpawnsNotSpawning().length === 0) {
creep.ttl--;
} else if (this.energyAvailable === this.energyCapacityAvailable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please look into .checkRoleToSpawn('claimer'

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, this would clear the spawning queue, when all extensions are filled and all spawns are currently spawning.

creep.ttl = 0;
}
return false;
};
Expand Down Expand Up @@ -473,7 +475,7 @@ Room.prototype.getCreepConfig = function(creep) {
Room.prototype.spawnCreateCreep = function(creep) {
const spawns = this.findSpawnsNotSpawning();
if (spawns.length === 0) {
return;
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change @return {boolean|void} to @return {boolean} in line 473 also

}

const config = this.getCreepConfig(creep);
Expand Down