summaryrefslogtreecommitdiff
path: root/ship_gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'ship_gui.c')
-rw-r--r--ship_gui.c12
1 files changed, 8 insertions, 4 deletions
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;