summaryrefslogtreecommitdiff
path: root/aircraft_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 /aircraft_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 'aircraft_gui.c')
-rw-r--r--aircraft_gui.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index 9bb7d020f..c488c1671 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -215,9 +215,11 @@ static void AircraftViewWndProc(Window *w, WindowEvent *e)
case WE_PAINT: {
const Vehicle *v = GetVehicle(w->window_number);
StringID str;
+ bool is_localplayer = v->owner == _local_player;
- SetWindowWidgetDisabledState(w, 7, v->owner != _local_player);
- SetWindowWidgetDisabledState(w, 8, !IsAircraftInHangarStopped(v) || v->owner != _local_player);
+ SetWindowWidgetDisabledState(w, 7, !is_localplayer);
+ SetWindowWidgetDisabledState(w, 8, !IsAircraftInHangarStopped(v) || !is_localplayer);
+ SetWindowWidgetDisabledState(w, 11, !is_localplayer);
/* draw widgets & caption */