summaryrefslogtreecommitdiff
path: root/players.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-02-22 20:32:26 +0000
committerDarkvater <darkvater@openttd.org>2005-02-22 20:32:26 +0000
commit0ddbc1304b161aad6583bd632634723645435f60 (patch)
treec1c059fd066da56290419c5652130232e50e2936 /players.c
parent1f66d602725c26c3b378724e7c73ecb7493edd9b (diff)
downloadopenttd-0ddbc1304b161aad6583bd632634723645435f60.tar.xz
(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
Diffstat (limited to 'players.c')
-rw-r--r--players.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/players.c b/players.c
index 8eb088af5..64c6c5252 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);
}