summaryrefslogtreecommitdiff
path: root/player_gui.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-15 01:52:23 +0000
committerdarkvater <darkvater@openttd.org>2005-01-15 01:52:23 +0000
commitf9b5f704b1f68520040364ff104a787bdb90a2fa (patch)
tree4ed1c8a9434e9c069105acea2e8eb7d812897e69 /player_gui.c
parent75474e5bf1bffa805102e0af87b43d9a51618fa1 (diff)
downloadopenttd-f9b5f704b1f68520040364ff104a787bdb90a2fa.tar.xz
(svn r1518) -Fix: server issue where some company names were wrong
-Fix: Highscore troubles; accessing members of deleted window
Diffstat (limited to 'player_gui.c')
-rw-r--r--player_gui.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/player_gui.c b/player_gui.c
index 94286c4a3..8bb257374 100644
--- a/player_gui.c
+++ b/player_gui.c
@@ -793,11 +793,15 @@ static void EndGameWndProc(Window *w, WindowEvent *e)
SetDParam(2, EndGameGetPerformanceTitleFromValue(p->old_economy[0].performance_history));
DrawStringMultiCenter(x + (640 / 2), y + 157, STR_021B_ACHIEVES_STATUS, 640);
}
- } break;
- case WE_CLICK: /* OnClick show the highscore chart */
+ } break;
+ case WE_CLICK: { /* OnClick show the highscore chart */
+ int diff = w->window_number; // save values because deletewindow is called
+ int8 rank = WP(w, highscore_d).rank;
DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
DeleteWindow(w);
- ShowHighscoreTable(w->window_number, WP(w, highscore_d).rank);
+
+ ShowHighscoreTable(diff, rank);
+ } break;
}
}