Industry::this_month_production should saturate instead of overflowing
This commit is contained in:
@@ -544,7 +544,7 @@ static bool TransportIndustryGoods(TileIndex tile)
|
|||||||
/* fluctuating economy? */
|
/* fluctuating economy? */
|
||||||
if (EconomyIsInRecession()) cw = (cw + 1) / 2;
|
if (EconomyIsInRecession()) cw = (cw + 1) / 2;
|
||||||
|
|
||||||
i->this_month_production[j] += cw;
|
i->this_month_production[j] = std::min<uint>(i->this_month_production[j] + cw, 0xFFFF);
|
||||||
|
|
||||||
uint am = MoveGoodsToStation(i->produced_cargo[j], cw, ST_INDUSTRY, i->index, &i->stations_near, i->exclusive_consumer);
|
uint am = MoveGoodsToStation(i->produced_cargo[j], cw, ST_INDUSTRY, i->index, &i->stations_near, i->exclusive_consumer);
|
||||||
i->this_month_transported[j] += am;
|
i->this_month_transported[j] += am;
|
||||||
|
Reference in New Issue
Block a user