Industry::this_month_production should saturate instead of overflowing

pull/362/head
Jonathan G Rennison 2 years ago
parent a4ea155d33
commit eab98e4808

@ -544,7 +544,7 @@ static bool TransportIndustryGoods(TileIndex tile)
/* fluctuating economy? */
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);
i->this_month_transported[j] += am;

Loading…
Cancel
Save