summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-06-17 20:32:25 +0000
committeryexo <yexo@openttd.org>2011-06-17 20:32:25 +0000
commit87e59dce5ade98ac63729d8028b657dc9e60a9f3 (patch)
tree02f9362dacbf34a329560b35716162b559572404
parentbf994b46f1441b4097093f8c8d1aa8f849c7c1da (diff)
downloadopenttd-87e59dce5ade98ac63729d8028b657dc9e60a9f3.tar.xz
(svn r22595) -Fix [FS#4560] (r22593): build railstation gui was broken with newgrf stations
-rw-r--r--src/station_gui.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 9d7759af5..dda06ee7a 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -84,6 +84,7 @@ static int DrawCargoListText(uint32 cargo_mask, const Rect &r, StringID prefix)
int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies)
{
TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
+ uint32 cargo_mask = 0;
if (_thd.drawstyle == HT_RECT && tile < MapSize()) {
CargoArray cargos;
if (supplies) {
@@ -93,7 +94,6 @@ int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageTyp
}
/* Convert cargo counts to a set of cargo bits, and draw the result. */
- uint32 cargo_mask = 0;
for (CargoID i = 0; i < NUM_CARGO; i++) {
switch (sct) {
case SCT_PASSENGERS_ONLY: if (!IsCargoInClass(i, CC_PASSENGERS)) continue; break;
@@ -103,11 +103,9 @@ int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageTyp
}
if (cargos[i] >= (supplies ? 1U : 8U)) SetBit(cargo_mask, i);
}
- Rect r = {left, top, right, INT32_MAX};
- return DrawCargoListText(cargo_mask, r, supplies ? STR_STATION_BUILD_SUPPLIES_CARGO : STR_STATION_BUILD_ACCEPTS_CARGO);
}
-
- return top;
+ Rect r = {left, top, right, INT32_MAX};
+ return DrawCargoListText(cargo_mask, r, supplies ? STR_STATION_BUILD_SUPPLIES_CARGO : STR_STATION_BUILD_ACCEPTS_CARGO);
}
/**