Changed update function of spawn to only check every 300 ticks.

This commit is contained in:
unknown
2023-08-30 23:53:35 +02:00
parent eda20c2dce
commit 5cfea80b19

View File

@@ -12,7 +12,8 @@ class _StructureSpawn extends StructureSpawn {
tick(){
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();
if(job){
const name = getJobName(job.role);