# HG changeset patch # User bjarni # Date 2006-08-28 06:13:16 # Node ID 814debb6f92461f4cb01174a1aca7614ec0e7471 # Parent 61ef70574b93e78ce764b004be66e9db21794218 (svn r6181) -Fix r6161: The list of vehicles using a certain station got a bit of display code mixed up with the list of vehicles with shared orders (nycom) diff --git a/aircraft_gui.c b/aircraft_gui.c --- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -1009,13 +1009,17 @@ static const Widget _other_player_aircra static void PlayerAircraftWndProc(Window *w, WindowEvent *e) { - OrderID order = GB(w->window_number, 16, 16); - /* Sorting a shared order list relies on station being set to INVALID_STATION */ - /* If station is not INVALID_STATION, then order is never used and we don't care what it contains */ - StationID station = (w->window_number & SHARE_FLAG) ? INVALID_STATION : order; + OrderID order = INVALID_ORDER; + StationID station = INVALID_STATION; PlayerID owner = GB(w->window_number, 0, 8); vehiclelist_d *vl = &WP(w, vehiclelist_d); + if (w->window_number & SHARE_FLAG) { + order = GB(w->window_number, 16, 16); + } else { + station = GB(w->window_number, 16, 16); + } + switch (e->event) { case WE_PAINT: { int x = 2; diff --git a/roadveh_gui.c b/roadveh_gui.c --- a/roadveh_gui.c +++ b/roadveh_gui.c @@ -947,13 +947,17 @@ static const Widget _other_player_roadve static void PlayerRoadVehWndProc(Window *w, WindowEvent *e) { - OrderID order = GB(w->window_number, 16, 16); - /* Sorting a shared order list relies on station being set to INVALID_STATION */ - /* If station is not INVALID_STATION, then order is never used and we don't care what it contains */ - StationID station = (w->window_number & SHARE_FLAG) ? INVALID_STATION : order; + OrderID order = INVALID_ORDER; + StationID station = INVALID_STATION; PlayerID owner = GB(w->window_number, 0, 8); vehiclelist_d *vl = &WP(w, vehiclelist_d); + if (w->window_number & SHARE_FLAG) { + order = GB(w->window_number, 16, 16); + } else { + station = GB(w->window_number, 16, 16); + } + switch (e->event) { case WE_PAINT: { int x = 2; diff --git a/ship_gui.c b/ship_gui.c --- a/ship_gui.c +++ b/ship_gui.c @@ -956,13 +956,17 @@ static const Widget _other_player_ships_ static void PlayerShipsWndProc(Window *w, WindowEvent *e) { - OrderID order = GB(w->window_number, 16, 16); - /* Sorting a shared order list relies on station being set to INVALID_STATION */ - /* If station is not INVALID_STATION, then order is never used and we don't care what it contains */ - StationID station = (w->window_number & SHARE_FLAG) ? INVALID_STATION : order; + OrderID order = INVALID_ORDER; + StationID station = INVALID_STATION; PlayerID owner = GB(w->window_number, 0, 8); vehiclelist_d *vl = &WP(w, vehiclelist_d); + if (w->window_number & SHARE_FLAG) { + order = GB(w->window_number, 16, 16); + } else { + station = GB(w->window_number, 16, 16); + } + switch (e->event) { case WE_PAINT: { int x = 2; diff --git a/train_gui.c b/train_gui.c --- a/train_gui.c +++ b/train_gui.c @@ -1406,13 +1406,17 @@ static const Widget _other_player_trains static void PlayerTrainsWndProc(Window *w, WindowEvent *e) { - OrderID order = GB(w->window_number, 16, 16); - /* Sorting a shared order list relies on station being set to INVALID_STATION */ - /* If station is not INVALID_STATION, then order is never used and we don't care what it contains */ - StationID station = (w->window_number & SHARE_FLAG) ? INVALID_STATION : order; + OrderID order = INVALID_ORDER; + StationID station = INVALID_STATION; PlayerID owner = GB(w->window_number, 0, 8); vehiclelist_d *vl = &WP(w, vehiclelist_d); + if (w->window_number & SHARE_FLAG) { + order = GB(w->window_number, 16, 16); + } else { + station = GB(w->window_number, 16, 16); + } + switch (e->event) { case WE_PAINT: { int x = 2;