diff options
author | bjarni <bjarni@openttd.org> | 2006-08-28 06:13:16 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-08-28 06:13:16 +0000 |
commit | 19cd783979b8183531270b28ec09f0e0f6da4579 (patch) | |
tree | a392adff285d84585d68164f2eb5d88e48a57a61 | |
parent | 34def0290ada45487ed63f9a9dd73c988a5398da (diff) | |
download | openttd-19cd783979b8183531270b28ec09f0e0f6da4579.tar.xz |
(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)
-rw-r--r-- | aircraft_gui.c | 12 | ||||
-rw-r--r-- | roadveh_gui.c | 12 | ||||
-rw-r--r-- | ship_gui.c | 12 | ||||
-rw-r--r-- | train_gui.c | 12 |
4 files changed, 32 insertions, 16 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c index 33f6c2bff..d32ce9dc0 100644 --- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -1009,13 +1009,17 @@ static const Widget _other_player_aircraft_widgets[] = { 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 index 536ecb47e..3fad036e5 100644 --- a/roadveh_gui.c +++ b/roadveh_gui.c @@ -947,13 +947,17 @@ static const Widget _other_player_roadveh_widgets[] = { 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 index 01ae5f803..312809abd 100644 --- a/ship_gui.c +++ b/ship_gui.c @@ -956,13 +956,17 @@ static const Widget _other_player_ships_widgets[] = { 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 index c09ed2185..90177ea62 100644 --- a/train_gui.c +++ b/train_gui.c @@ -1406,13 +1406,17 @@ static const Widget _other_player_trains_widgets[] = { 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; |