mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 12:59:33 +00:00
(svn r15888) -Fix (r15103)[FS#2772]: Round the production rate up, so e.g. oilrigs always produce some passengers on lowest production level.
This commit is contained in:
parent
9eff54febe
commit
f436a58b5e
@ -2211,8 +2211,9 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
|
||||
/* Recalculate production_rate
|
||||
* For non-smooth economy these should always be synchronized with prod_level */
|
||||
if (recalculate_multipliers) {
|
||||
i->production_rate[0] = min(indspec->production_rate[0] * i->prod_level / PRODLEVEL_DEFAULT, 0xFF);
|
||||
i->production_rate[1] = min(indspec->production_rate[1] * i->prod_level / PRODLEVEL_DEFAULT, 0xFF);
|
||||
/* Rates are rounded up, so e.g. oilrig always produces some passengers */
|
||||
i->production_rate[0] = min((indspec->production_rate[0] * i->prod_level + PRODLEVEL_DEFAULT - 1) / PRODLEVEL_DEFAULT, 0xFF);
|
||||
i->production_rate[1] = min((indspec->production_rate[1] * i->prod_level + PRODLEVEL_DEFAULT - 1) / PRODLEVEL_DEFAULT, 0xFF);
|
||||
}
|
||||
|
||||
/* Close if needed and allowed */
|
||||
|
Loading…
Reference in New Issue
Block a user