From d1fe247969d20c2dd8a4157f36b6d8fdd3a33ac9 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Tue, 22 Feb 2005 20:32:26 +0000 Subject: [PATCH] (svn r1906) - Fix: [ 1117327 ] Assertion error on kick. When a company is cleaned all its windows need to be closed. For global vehicle lists, the no-staiton index of -1 was not taken into account --- players.c | 10 ++++++---- train_gui.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/players.c b/players.c index 8eb088af53..64c6c52526 100644 --- a/players.c +++ b/players.c @@ -609,10 +609,12 @@ void DeletePlayerWindows(int pi) DeleteWindowById(WC_COMPANY, pi); DeleteWindowById(WC_FINANCES, pi); DeleteWindowById(WC_STATION_LIST, pi); - DeleteWindowById(WC_TRAINS_LIST, pi); - DeleteWindowById(WC_ROADVEH_LIST, pi); - DeleteWindowById(WC_SHIPS_LIST, pi); - DeleteWindowById(WC_AIRCRAFT_LIST, pi); + /* The vehicle list windows also have station in the window_number + * A stationindex of -1 means the global vehicle list */ + DeleteWindowById(WC_TRAINS_LIST, (-1 << 16) | pi); + DeleteWindowById(WC_ROADVEH_LIST, (-1 << 16) | pi); + DeleteWindowById(WC_SHIPS_LIST, (-1 << 16) | pi); + DeleteWindowById(WC_AIRCRAFT_LIST, (-1 << 16) | pi); DeleteWindowById(WC_BUY_COMPANY, pi); } diff --git a/train_gui.c b/train_gui.c index b477cf25b3..9bd4970243 100644 --- a/train_gui.c +++ b/train_gui.c @@ -1487,7 +1487,7 @@ void ShowPlayerTrains(int player, int station) w = AllocateWindowDescFront(&_other_player_trains_desc, (station << 16) | player); } if (w) { - w->caption_color = w->window_number; + w->caption_color = player; w->hscroll.cap = 10; w->vscroll.cap = 7; // maximum number of vehicles shown w->widget[7].unkA = (w->vscroll.cap << 8) + 1;