diff options
author | frosch <frosch@openttd.org> | 2013-04-13 13:42:08 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-04-13 13:42:08 +0000 |
commit | 5eddbb338b7838c01087921c77c0738fc12cbfb2 (patch) | |
tree | e1d1b917bc00b6e7e43aad49188c98b635887b12 /src/station_gui.cpp | |
parent | 8d1d521456c57b69243853b369ecc60de0421e33 (diff) | |
download | openttd-5eddbb338b7838c01087921c77c0738fc12cbfb2.tar.xz |
(svn r25185) -Fix [FS#5508]: Remove ambivalent functions CargoList::Empty() and Count(), and replace them with VehicleCargoList::StoredCount(), TotalCount(), StationCargoList::AvailableCount() and TotalCount(). (fonsinchen)
Diffstat (limited to 'src/station_gui.cpp')
-rw-r--r-- | src/station_gui.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 98c5b3d22..1071ca429 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -231,8 +231,8 @@ protected: CargoID j; FOR_EACH_SET_CARGO_ID(j, cargo_filter) { - if (!(*a)->goods[j].cargo.Empty()) diff += GetTransportedGoodsIncome((*a)->goods[j].cargo.Count(), 20, 50, j); - if (!(*b)->goods[j].cargo.Empty()) diff -= GetTransportedGoodsIncome((*b)->goods[j].cargo.Count(), 20, 50, j); + if ((*a)->goods[j].cargo.TotalCount() > 0) diff += GetTransportedGoodsIncome((*a)->goods[j].cargo.TotalCount(), 20, 50, j); + if ((*b)->goods[j].cargo.TotalCount() > 0) diff -= GetTransportedGoodsIncome((*b)->goods[j].cargo.TotalCount(), 20, 50, j); } return ClampToI32(diff); @@ -407,7 +407,7 @@ public: /* show cargo waiting and station ratings */ for (uint j = 0; j < _sorted_standard_cargo_specs_size; j++) { CargoID cid = _sorted_cargo_specs[j]->Index(); - if (!st->goods[cid].cargo.Empty()) { + if (st->goods[cid].cargo.TotalCount() > 0) { /* For RTL we work in exactly the opposite direction. So * decrement the space needed first, then draw to the left * instead of drawing to the left and then incrementing @@ -416,7 +416,7 @@ public: x -= 20; if (x < r.left + WD_FRAMERECT_LEFT) break; } - StationsWndShowStationRating(x, x + 16, y, cid, st->goods[cid].cargo.Count(), st->goods[cid].rating); + StationsWndShowStationRating(x, x + 16, y, cid, st->goods[cid].cargo.TotalCount(), st->goods[cid].rating); if (!rtl) { x += 20; if (x > r.right - WD_FRAMERECT_RIGHT) break; @@ -934,7 +934,7 @@ struct StationViewWindow : public Window { /* count types of cargoes waiting in station */ for (CargoID i = 0; i < NUM_CARGO; i++) { - if (st->goods[i].cargo.Empty()) { + if (st->goods[i].cargo.TotalCount() == 0) { this->cargo_rows[i] = 0; } else { /* Add an entry for total amount of cargo of this type waiting. */ @@ -994,7 +994,7 @@ struct StationViewWindow : public Window { if (--pos < 0) { StringID str = STR_JUST_NOTHING; for (CargoID i = 0; i < NUM_CARGO; i++) { - if (!st->goods[i].cargo.Empty()) str = STR_EMPTY; + if (st->goods[i].cargo.TotalCount() > 0) str = STR_EMPTY; } SetDParam(0, str); DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_STATION_VIEW_WAITING_TITLE); |