summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r--vehicle_gui.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index df33fd69c..2eaad2ee0 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -1856,8 +1856,11 @@ static const WindowDesc _player_vehicle_list_aircraft_desc = {
static void ShowVehicleListWindowLocal(PlayerID player, byte vehicle_type, StationID station, OrderID order, uint16 depot_airport_index)
{
Window *w;
- WindowNumber num = (vehicle_type << 11) | player;
+ WindowNumber num;
+ if (!IsValidPlayer(player)) return;
+
+ num = (vehicle_type << 11) | player;
if (order != INVALID_ORDER) {
num |= (order << 16) | VLW_SHARED_ORDERS;
} else if (depot_airport_index != INVALID_STATION) {