mirror of https://github.com/OpenTTD/OpenTTD
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.pull/11136/head
parent
3ac663e619
commit
c3d1264a4b
|
@ -67,6 +67,12 @@ public:
|
||||||
|
|
||||||
void Save(Industry::ProducedCargo *p) const override
|
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());
|
SlSetStructListLength(p->history.size());
|
||||||
|
|
||||||
for (auto &h : p->history) {
|
for (auto &h : p->history) {
|
||||||
|
|
Loading…
Reference in New Issue