(svn r17720) -Codechange: guard the CargoPacket variables that are cached in CargoLists so they cannot be written from outside the CargoList class (based on patch by fonsinchen)

This commit is contained in:
rubidium
2009-10-06 17:23:15 +00:00
parent a4835e3f0b
commit 5f59d0c5b4
9 changed files with 118 additions and 51 deletions

View File

@@ -840,13 +840,13 @@ struct StationViewWindow : public Window {
for (CargoDataList::iterator jt = cargolist.begin(); jt != cargolist.end(); jt++) {
CargoData *cd = &(*jt);
if (cd->cargo == i && cd->source == cp->source) {
cd->count += cp->count;
cd->count += cp->Count();
added = true;
break;
}
}
if (!added) cargolist.push_back(CargoData(i, cp->source, cp->count));
if (!added) cargolist.push_back(CargoData(i, cp->source, cp->Count()));
}
}
}