* Helper for ProduceIndustryGoods that scales and produces cargos. * @param i The industry * @param scale Should we scale production of this cargo directly? */
| 1146 | * @param scale Should we scale production of this cargo directly? |
| 1147 | */ |
| 1148 | static void ProduceIndustryGoodsHelper(Industry *i, bool scale) |
| 1149 | { |
| 1150 | for (auto &p : i->produced) { |
| 1151 | if (!IsValidCargoType(p.cargo)) continue; |
| 1152 | |
| 1153 | uint16_t amount = p.rate; |
| 1154 | if (scale) amount = ScaleByCargoScale(amount, false); |
| 1155 | |
| 1156 | p.waiting = ClampTo<uint16_t>(p.waiting + amount); |
| 1157 | } |
| 1158 | } |
| 1159 | |
| 1160 | static void ProduceIndustryGoods(Industry *i) |
| 1161 | { |
no test coverage detected