summaryrefslogtreecommitdiff
path: root/player_gui.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-31 01:45:41 +0000
committerDarkvater <darkvater@openttd.org>2006-10-31 01:45:41 +0000
commit8b12e25468fa18b360bace14333bab5887cba289 (patch)
treee3a412fa17c1578ae2503b69cc22e0ed46f9799d /player_gui.c
parentae5eac42de71f7d419b91a7fa96431a6bc72e3aa (diff)
downloadopenttd-8b12e25468fa18b360bace14333bab5887cba289.tar.xz
(svn r7008) -Fix [FS#369]: Crash at game end when server company is bankrupt
Diffstat (limited to 'player_gui.c')
-rw-r--r--player_gui.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/player_gui.c b/player_gui.c
index b1bd848c3..4ec06e7c3 100644
--- a/player_gui.c
+++ b/player_gui.c
@@ -967,11 +967,14 @@ static void EndGameWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
case WE_PAINT: {
- const Player *p = GetPlayer(_local_player);
+ const Player *p;
uint x, y;
SetupHighScoreEndWindow(w, &x, &y);
+ if (!IsValidPlayer(_local_player)) break;
+
+ p = GetPlayer(_local_player);
/* We need to get performance from last year because the image is shown
* at the start of the new year when these things have already been copied */
if (WP(w, highscore_d).background_img == SPR_TYCOON_IMG2_BEGIN) { // Tycoon of the century \o/