changeset 4426:245a49d54300 draft

(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)
author bjarni <bjarni@openttd.org>
date Mon, 28 Aug 2006 06:13:16 +0000
parents 689f099b78ea
children 2fc1b6507eb1
files aircraft_gui.c roadveh_gui.c ship_gui.c train_gui.c
diffstat 4 files changed, 32 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -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;
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -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;
--- a/ship_gui.c
+++ b/ship_gui.c
@@ -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;
--- a/train_gui.c
+++ b/train_gui.c
@@ -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;