-
Notifications
You must be signed in to change notification settings - Fork 155
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
base: master
Are you sure you want to change the base?
bugfix: don't try to produce cliamer in a room that cannot. #695
Conversation
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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) { |
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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.
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
No description provided.