summaryrefslogtreecommitdiff
path: root/ship_gui.c
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2006-11-14 00:02:02 +0000
committerglx <glx@openttd.org>2006-11-14 00:02:02 +0000
commit30bc338f908f8f0a741f3844b377cbc60e41b76b (patch)
treedc366442b4e7abb822005ad628fc12a198926a6a /ship_gui.c
parented46b7d3807f4cd6bfe3ace57faa41076ab3e998 (diff)
downloadopenttd-30bc338f908f8f0a741f3844b377cbc60e41b76b.tar.xz
(svn r7142) -Fix: disable clone button in vehicle view for not owned vehicles (was already done for trains)
Diffstat (limited to 'ship_gui.c')
-rw-r--r--ship_gui.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ship_gui.c b/ship_gui.c
index 37505a8a9..0dbe32468 100644
--- a/ship_gui.c
+++ b/ship_gui.c
@@ -380,11 +380,13 @@ static void ShipViewWndProc(Window *w, WindowEvent *e)
Vehicle *v = GetVehicle(w->window_number);
StringID str;
bool refitable_and_stopped_in_depot = ShipVehInfo(v->engine_type)->refittable && IsShipInDepotStopped(v);
+ bool is_localplayer = v->owner == _local_player;
- SetWindowWidgetDisabledState(w, 7, v->owner != _local_player);
- SetWindowWidgetDisabledState(w, 8,
- v->owner != _local_player || // Disable if owner is not local player
+ SetWindowWidgetDisabledState(w, 7, !is_localplayer);
+ SetWindowWidgetDisabledState(w, 8,
+ !is_localplayer || // Disable if owner is not local player
!refitable_and_stopped_in_depot); // Disable if the ship is not refitable or stopped in a depot
+ SetWindowWidgetDisabledState(w, 11, !is_localplayer);
/* draw widgets & caption */
SetDParam(0, v->string_id);