summaryrefslogtreecommitdiff
path: root/ship_gui.c
diff options
context:
space:
mode:
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);