(svn r25394) -Fix: Restrict renaming engines to the server, just like renaming towns.

This commit is contained in:
frosch
2013-06-11 18:24:01 +00:00
parent 1e85b5e262
commit eba028f3ca
2 changed files with 5 additions and 1 deletions

View File

@@ -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;