summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-03-25 19:30:23 +0000
committerGitHub <noreply@github.com>2019-03-25 19:30:23 +0000
commita4073895aeb0ceedd965ed691c2888500a542612 (patch)
treef572f2461e79fdf520e68014ff28995bac563c2f /src
parent10f0c1e3cdd1f45dd3de5a12170ef870f27c2c32 (diff)
downloadopenttd-a4073895aeb0ceedd965ed691c2888500a542612.tar.xz
Fix #7411: Use industry production callback (if used) on initial industry cargo generation. (#7412)
Diffstat (limited to 'src')
-rw-r--r--src/industry_cmd.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index a4863ab12..403e57a96 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1751,8 +1751,16 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
}
if (_generating_world) {
+ if (HasBit(indspec->callback_mask, CBM_IND_PRODUCTION_256_TICKS)) {
+ IndustryProductionCallback(i, 1);
+ for (size_t ci = 0; ci < lengthof(i->last_month_production); ci++) {
+ i->last_month_production[ci] = i->produced_cargo_waiting[ci] * 8;
+ i->produced_cargo_waiting[ci] = 0;
+ }
+ }
+
for (size_t ci = 0; ci < lengthof(i->last_month_production); ci++) {
- i->last_month_production[ci] = i->production_rate[ci] * 8;
+ i->last_month_production[ci] += i->production_rate[ci] * 8;
}
}