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

Conversation

XenoAmess
Copy link
Contributor

No description provided.

@@ -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

@@ -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.

Copy link
Owner

@TooAngel TooAngel left a comment

Choose a reason for hiding this comment

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

I doubt this would work out. If there is a bug with the claimer (e.g. it tries to spawns but the rooms does not have enough max energy). The claimer shouldn't be queued at all.

@@ -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
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants