diff --git a/src/core/execution/TrainStationExecution.ts b/src/core/execution/TrainStationExecution.ts index 5053dffd7..163a73bad 100644 --- a/src/core/execution/TrainStationExecution.ts +++ b/src/core/execution/TrainStationExecution.ts @@ -62,13 +62,9 @@ export class TrainStationExecution implements Execution { private spawnTrain(station: TrainStation, currentTick: number) { if (this.mg === undefined) throw new Error("Not initialized"); + if (!this.spawnTrains) return; if (this.random === undefined) throw new Error("Not initialized"); - if ( - !this.spawnTrains || - currentTick - this.lastSpawnTick < this.ticksCooldown - ) { - return; - } + if (currentTick < this.lastSpawnTick + this.ticksCooldown) return; const cluster = station.getCluster(); if (cluster === null) { return;