diff options
author | peter1138 <peter1138@openttd.org> | 2007-02-23 09:56:20 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-02-23 09:56:20 +0000 |
commit | 7e73413709b3f830d83338421298af5dc20581db (patch) | |
tree | 2fa52d1955fc03be8152cb9d7b298bfce4b80664 /src/station_gui.cpp | |
parent | 0ed4b64e649349f695a1942e0fa09b8b564e1774 (diff) | |
download | openttd-7e73413709b3f830d83338421298af5dc20581db.tar.xz |
(svn r8858) -Codechange: Replace magic number test with class method for determining if a cargo is valid/active.
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 cc9bcb65b..7b7a2c341 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -59,7 +59,7 @@ static StationSortListingTypeFunction StationRatingMaxSorter; static void StationsWndShowStationRating(int x, int y, CargoID type, uint amount, byte rating) { const CargoSpec *cs = GetCargo(type); - if (cs->bitnum == 0xFF) return; + if (!cs->IsValid()) return; int colour = cs->rating_colour; uint w = (minu(amount, 576) + 5) / 36; @@ -328,7 +328,7 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e) cg_ofst = IsWindowWidgetLowered(w, i + STATIONLIST_WIDGET_CARGOSTART) ? 2 : 1; const CargoSpec *cs = GetCargo(i); - if (cs->bitnum != 0xFF) { + if (cs->IsValid()) { GfxFillRect(x + cg_ofst, y + cg_ofst, x + cg_ofst + 10 , y + cg_ofst + 7, cs->rating_colour); DrawStringCentered(x + 6 + cg_ofst, y + cg_ofst, cs->abbrev, 0x10); } |