summaryrefslogtreecommitdiff
path: root/src/build_vehicle_gui.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-07-13 14:51:55 +0000
committertruelight <truelight@openttd.org>2007-07-13 14:51:55 +0000
commita84dcf7682e1fcf4a28e0d08f5a98bac968fa79a (patch)
tree0939424feee1ed866ee601466cb504bad351491e /src/build_vehicle_gui.cpp
parent243c59be6f910ed8c2bcfc8c8c03dd1839b32ca1 (diff)
downloadopenttd-a84dcf7682e1fcf4a28e0d08f5a98bac968fa79a.tar.xz
(svn r10546) -Fix [FS#1026]: you can now have both Available Train as Available Ship window open
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r--src/build_vehicle_gui.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 111cced0b..0c3c5d8a5 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -1055,12 +1055,17 @@ void ShowBuildVehicleWindow(TileIndex tile, VehicleType type)
{
buildvehicle_d *bv;
Window *w;
+ /* We want to be able to open both Available Train as Available Ships,
+ * so if tile == 0 (Available XXX Window), use 'type' as unique number.
+ * As it always is a low value, it won't collide with any real tile
+ * number. */
+ uint num = (tile == 0) ? (int)type : tile;
assert(IsPlayerBuildableVehicleType(type));
- DeleteWindowById(WC_BUILD_VEHICLE, tile);
+ DeleteWindowById(WC_BUILD_VEHICLE, num);
- w = AllocateWindowDescFront(&_build_vehicle_desc, tile);
+ w = AllocateWindowDescFront(&_build_vehicle_desc, num);
if (w == NULL) return;