diff options
author | rubidium <rubidium@openttd.org> | 2007-07-12 13:40:24 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-12 13:40:24 +0000 |
commit | 7cd00468d6f6bbe81dba02761c0b3110596ef0c3 (patch) | |
tree | e986cc1d16371565e3936109564f6db81a52476d /src/misc_gui.cpp | |
parent | 6f0db273d649b5f607f4e3fc85c93945169fb9a2 (diff) | |
download | openttd-7cd00468d6f6bbe81dba02761c0b3110596ef0c3.tar.xz |
(svn r10522) -Fix: the "build truck station" GUI showed that it would accept tourists when it does not, whereas the "build bus station" GUI did not show them when it did accept them.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 7abe9ac37..f3b14639c 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -751,16 +751,22 @@ void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[ static void DrawStationCoverageText(const AcceptedCargo accepts, - int str_x, int str_y, uint mask) + int str_x, int str_y, StationCoverageType sct) { char *b = _userstring; bool first = true; b = InlineString(b, STR_000D_ACCEPTS); - for (CargoID i = 0; i < NUM_CARGO; i++, mask >>= 1) { + for (CargoID i = 0; i < NUM_CARGO; i++) { if (b >= lastof(_userstring) - 5) break; - if (accepts[i] >= 8 && mask & 1) { + switch (sct) { + case SCT_PASSENGERS_ONLY: if (!IsCargoInClass(i, CC_PASSENGERS)) continue; break; + case SCT_NON_PASSENGERS_ONLY: if (IsCargoInClass(i, CC_PASSENGERS)) continue; break; + case SCT_ALL: break; + default: NOT_REACHED(); + } + if (accepts[i] >= 8) { if (first) { first = false; } else { @@ -779,12 +785,12 @@ static void DrawStationCoverageText(const AcceptedCargo accepts, DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144); } -void DrawStationCoverageAreaText(int sx, int sy, uint mask, int rad) { +void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad) { TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y); AcceptedCargo accepts; if (tile < MapSize()) { GetAcceptanceAroundTiles(accepts, tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE , rad); - DrawStationCoverageText(accepts, sx, sy, mask); + DrawStationCoverageText(accepts, sx, sy, sct); } } |