Limit maximum production quantity in DirectorWorker: Updated the production calculation to cap the output at 100 units per start, ensuring it does not exceed available capacity or financial constraints. Enhanced comments for better understanding of the production limits.

This commit is contained in:
Torsten Schulz (local)
2025-12-01 15:55:59 +01:00
parent bd9fbb80c0
commit 513862a157

View File

@@ -496,7 +496,14 @@ impl DirectorWorker {
}
}
let to_produce = free_capacity.min(max_money_production).min(300).max(0);
// Maximale Produktionsmenge begrenzen:
// - nie mehr als der freie Lagerplatz (`free_capacity`)
// - nie mehr als durch das verfügbare Geld finanzierbar
// - absolut maximal 100 Einheiten pro Start
let to_produce = free_capacity
.min(max_money_production)
.min(100)
.max(0);
eprintln!(
"[DirectorWorker] Produktionsberechnung: free_capacity={}, one_piece_cost={}, max_money_production={}, to_produce={}",