mirror of https://github.com/OpenTTD/OpenTTD.git
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.
This commit is contained in:
parent
3ac663e619
commit
c3d1264a4b
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue