Changeset - r23511:3254c23c07c9
[Not reviewed]
master
0 1 0
PeterN - 6 years ago 2019-03-25 19:30:23
peter@fuzzle.org
Fix #7411: Use industry production callback (if used) on initial industry cargo generation. (#7412)
1 file changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -1751,8 +1751,16 @@ static void DoCreateNewIndustry(Industry
 
	}
 

	
 
	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;
 
		}
 
	}
 

	
0 comments (0 inline, 0 general)