diff options
author | rubidium <rubidium@openttd.org> | 2009-10-06 17:23:15 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-10-06 17:23:15 +0000 |
commit | 5f59d0c5b4e85a3bb51936fa05b2c5493f571eca (patch) | |
tree | ca2af53f7c2c4af662725813b62d480a3748954d /src/station_gui.cpp | |
parent | a4835e3f0b8c0d4f330fc8e91bdd529af60cc7a3 (diff) | |
download | openttd-5f59d0c5b4e85a3bb51936fa05b2c5493f571eca.tar.xz |
(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)
Diffstat (limited to 'src/station_gui.cpp')
-rw-r--r-- | src/station_gui.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp index dc5174380..01e1caa63 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -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())); } } } |