Changeset - r27720:10c73e4805be
[Not reviewed]
master
0 1 0
PeterN - 14 months ago 2023-07-14 10:12:22
peter1138@openttd.org
Change: Don't save industry history if cargo slot isn't used. (#11133)

This avoids saving history of 16 slots per industry when in many cases (NewGRF dependent) only a couple are used.
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/saveload/industry_sl.cpp
Show inline comments
 
@@ -67,6 +67,12 @@ public:
 

	
 
	void Save(Industry::ProducedCargo *p) const override
 
	{
 
		if (!IsValidCargoID(p->cargo)) {
 
			/* Don't save any history if cargo slot isn't used. */
 
			SlSetStructListLength(0);
 
			return;
 
		}
 

	
 
		SlSetStructListLength(p->history.size());
 

	
 
		for (auto &h : p->history) {
0 comments (0 inline, 0 general)