summaryrefslogtreecommitdiff
path: root/station_gui.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-05-14 22:03:25 +0000
committerDarkvater <darkvater@openttd.org>2005-05-14 22:03:25 +0000
commit220e5be863b020dde8b40216d49e83f9de400ad7 (patch)
treeab3843d35cc922f25558e8577c4d0a4acae9ecbc /station_gui.c
parent32bb69ef1cd66bd62791dab3f258201e3942ad37 (diff)
downloadopenttd-220e5be863b020dde8b40216d49e83f9de400ad7.tar.xz
(svn r2313) - Fix: [ 1202115 ] Clicking shipslist on bouy asserts GetPlayer(). Bouys and oilrigs don't have owners, so it cannot get the vehicle-list of the station-owner. Just use _current_player
Diffstat (limited to 'station_gui.c')
-rw-r--r--station_gui.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/station_gui.c b/station_gui.c
index c28861cdc..608e292e7 100644
--- a/station_gui.c
+++ b/station_gui.c
@@ -472,27 +472,31 @@ static void StationViewWndProc(Window *w, WindowEvent *e)
ShowQueryString(st->string_id, STR_3030_RENAME_STATION_LOADING, 31, 180, w->window_class, w->window_number);
} break;
- case 10: {
+ case 10: { /* Show a list of scheduled trains to this station */
const Station *st = GetStation(w->window_number);
ShowPlayerTrains(st->owner, w->window_number);
break;
}
- case 11: {
+ case 11: { /* Show a list of scheduled road-vehicles to this station */
const Station *st = GetStation(w->window_number);
ShowPlayerRoadVehicles(st->owner, w->window_number);
break;
}
- case 12: {
+ case 12: { /* Show a list of scheduled aircraft to this station */
const Station *st = GetStation(w->window_number);
- ShowPlayerAircraft(st->owner, w->window_number);
+ /* Since oilrigs have no owners, show the scheduled aircraft of current player */
+ PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner;
+ ShowPlayerAircraft(owner, w->window_number);
break;
}
- case 13: {
+ case 13: { /* Show a list of scheduled ships to this station */
const Station *st = GetStation(w->window_number);
- ShowPlayerShips(st->owner, w->window_number);
+ /* Since oilrigs/bouys have no owners, show the scheduled ships of current player */
+ PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner;
+ ShowPlayerShips(owner, w->window_number);
break;
}
}