diff options
author | frosch <frosch@openttd.org> | 2013-06-11 18:24:01 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-06-11 18:24:01 +0000 |
commit | c73219f9e5a640a07b1ec6b6e4b875aaf7304eb2 (patch) | |
tree | 4a57f19c769c34ebd595810c292263a36e139577 /src/build_vehicle_gui.cpp | |
parent | 040562909bc14f2b3870e6ac3cd0722714d0a32d (diff) | |
download | openttd-c73219f9e5a640a07b1ec6b6e4b875aaf7304eb2.tar.xz |
(svn r25394) -Fix: Restrict renaming engines to the server, just like renaming towns.
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r-- | src/build_vehicle_gui.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index ceea90c5b..3677d0afe 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -13,6 +13,7 @@ #include "engine_base.h" #include "engine_func.h" #include "station_base.h" +#include "network/network.h" #include "articulated_vehicles.h" #include "textbuf_gui.h" #include "command_func.h" @@ -971,6 +972,9 @@ struct BuildVehicleWindow : Window { * So we just hide it, and enlarge the Rename button by the now vacant place. */ if (this->listview_mode) this->GetWidget<NWidgetStacked>(WID_BV_BUILD_SEL)->SetDisplayedPlane(SZSP_NONE); + /* disable renaming engines in network games if you are not the server */ + this->SetWidgetDisabledState(WID_BV_RENAME, _networking && !_network_server); + NWidgetCore *widget = this->GetWidget<NWidgetCore>(WID_BV_LIST); widget->tool_tip = STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP + type; |