summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-08-04 14:04:15 +0000
committerplanetmaker <planetmaker@openttd.org>2011-08-04 14:04:15 +0000
commit75b92328c224477d9690226bf2eab45c041be095 (patch)
tree85624fa983e4b54898f59593ede454e82e90def1 /src
parent08b7981f37431f57ca2fa8dd25db4088c7c69d4e (diff)
downloadopenttd-75b92328c224477d9690226bf2eab45c041be095.tar.xz
(svn r22714) -Fix: If there's no point in opening the rail toolbar, don't open it for people who use hotkeys either rather than only for those using GUI elements
Diffstat (limited to 'src')
-rw-r--r--src/rail_gui.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 9a5af6c5e..3f8d167d4 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -31,6 +31,7 @@
#include "core/geometry_func.hpp"
#include "hotkeys.h"
#include "engine_base.h"
+#include "vehicle_func.h"
#include "station_map.h"
#include "tunnelbridge_map.h"
@@ -849,6 +850,7 @@ Window *ShowBuildRailToolbar(RailType railtype)
EventState RailToolbarGlobalHotkeys(uint16 key, uint16 keycode)
{
+ if (!CanBuildVehicleInfrastructure(VEH_TRAIN)) return ES_NOT_HANDLED;
extern RailType _last_built_railtype;
int num = CheckHotkeyMatch<BuildRailToolbarWindow>(_railtoolbar_hotkeys, keycode, NULL, true);
if (num == -1) return ES_NOT_HANDLED;