Changed update function of spawn to only check every 300 ticks.
This commit is contained in:
@@ -12,7 +12,8 @@ class _StructureSpawn extends StructureSpawn {
|
|||||||
|
|
||||||
tick(){
|
tick(){
|
||||||
if(!this.memory.init) this.begin();
|
if(!this.memory.init) this.begin();
|
||||||
if(this.store.getUsedCapacity(RESOURCE_ENERGY) < 300) return;
|
if(Game.time%300) return;
|
||||||
|
if(this.room.energyAvailable < 300) return;
|
||||||
const job = this.room.memory.vacancies.pop();
|
const job = this.room.memory.vacancies.pop();
|
||||||
if(job){
|
if(job){
|
||||||
const name = getJobName(job.role);
|
const name = getJobName(job.role);
|
||||||
|
|||||||
Reference in New Issue
Block a user