summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aircraft_gui.c6
-rw-r--r--roadveh_gui.c8
-rw-r--r--ship_gui.c8
3 files changed, 14 insertions, 8 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 */
diff --git a/roadveh_gui.c b/roadveh_gui.c
index acf0173de..fef339163 100644
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -235,11 +235,13 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
case WE_PAINT: {
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, v->owner != _local_player);
+ SetWindowWidgetDisabledState(w, 7, !is_localplayer);
+ SetWindowWidgetDisabledState(w, 8, !is_localplayer);
+ SetWindowWidgetDisabledState(w, 11, !is_localplayer);
/* Disable refit button if vehicle not refittable */
- SetWindowWidgetDisabledState(w, 12, v->owner != _local_player ||
+ SetWindowWidgetDisabledState(w, 12, !is_localplayer ||
_engine_info[v->engine_type].refit_mask == 0);
/* draw widgets & caption */
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);