# HG changeset patch # User bjarni # Date 1156745596 0 # Node ID 2914906914729e8cd42622561ed23c9ad271bbf1 # Parent cff9af513dec3ceb525788676b810b3adf8d6a74 (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 -r cff9af513dec -r 291490691472 aircraft_gui.c --- a/aircraft_gui.c Mon Aug 28 06:05:04 2006 +0000 +++ b/aircraft_gui.c Mon Aug 28 06:13:16 2006 +0000 @@ -1009,13 +1009,17 @@ 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 -r cff9af513dec -r 291490691472 roadveh_gui.c --- a/roadveh_gui.c Mon Aug 28 06:05:04 2006 +0000 +++ b/roadveh_gui.c Mon Aug 28 06:13:16 2006 +0000 @@ -947,13 +947,17 @@ 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 -r cff9af513dec -r 291490691472 ship_gui.c --- a/ship_gui.c Mon Aug 28 06:05:04 2006 +0000 +++ b/ship_gui.c Mon Aug 28 06:13:16 2006 +0000 @@ -956,13 +956,17 @@ 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 -r cff9af513dec -r 291490691472 train_gui.c --- a/train_gui.c Mon Aug 28 06:05:04 2006 +0000 +++ b/train_gui.c Mon Aug 28 06:13:16 2006 +0000 @@ -1406,13 +1406,17 @@ 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;