* Recompute #production_rate for current #prod_level. * This function is only valid when not using smooth economy. */
| 2590 | * This function is only valid when not using smooth economy. |
| 2591 | */ |
| 2592 | void Industry::RecomputeProductionMultipliers() |
| 2593 | { |
| 2594 | const IndustrySpec *indspec = GetIndustrySpec(this->type); |
| 2595 | assert(indspec->UsesOriginalEconomy()); |
| 2596 | |
| 2597 | /* Rates are rounded up, so e.g. oilrig always produces some passengers */ |
| 2598 | for (auto &p : this->produced) { |
| 2599 | p.rate = ClampTo<uint8_t>(CeilDiv(indspec->production_rate[&p - this->produced.data()] * this->prod_level, PRODLEVEL_DEFAULT)); |
| 2600 | } |
| 2601 | } |
| 2602 | |
| 2603 | void Industry::FillCachedName() const |
| 2604 | { |
no test coverage detected