feat: more trade when there are few ports worldwide (#242)

This commit is contained in:
Ilan Schemoul
2025-03-14 17:45:40 +01:00
committed by GitHub
parent c4f612eb98
commit da50aa28d2
3 changed files with 11 additions and 3 deletions
+4 -1
View File
@@ -66,7 +66,10 @@ export class PortExecution implements Execution {
return;
}
if (!this.random.chance(this.mg.config().tradeShipSpawnRate())) {
const totalNbOfPorts = this.mg.units(UnitType.Port).length;
if (
!this.random.chance(this.mg.config().tradeShipSpawnRate(totalNbOfPorts))
) {
return;
}