mirror of https://github.com/OpenTTD/OpenTTD
(svn r1578) -Fix: [1102454] dedicated server crashes after some hours (highscore problems for dedicated...should be really solved now)
parent
2e0d576e6b
commit
c245d93e7d
26
player_gui.c
26
player_gui.c
|
@ -896,7 +896,6 @@ void ShowHighscoreTable(int difficulty, int8 ranking)
|
||||||
void ShowEndGameChart(void)
|
void ShowEndGameChart(void)
|
||||||
{
|
{
|
||||||
Window *w;
|
Window *w;
|
||||||
const Player *p = DEREF_PLAYER(_local_player);
|
|
||||||
|
|
||||||
if (!_networking) { // pause the game and hide all windows to show end-chart
|
if (!_networking) { // pause the game and hide all windows to show end-chart
|
||||||
DoCommandP(0, 1, 0, NULL, CMD_PAUSE);
|
DoCommandP(0, 1, 0, NULL, CMD_PAUSE);
|
||||||
|
@ -908,10 +907,25 @@ void ShowEndGameChart(void)
|
||||||
|
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
MarkWholeScreenDirty();
|
MarkWholeScreenDirty();
|
||||||
|
|
||||||
|
WP(w, highscore_d).background_img = SPR_TYCOON_IMG1_BEGIN;
|
||||||
|
|
||||||
|
if (_local_player != OWNER_SPECTATOR) {
|
||||||
|
const Player *p = DEREF_PLAYER(_local_player);
|
||||||
|
if (p->old_economy[0].performance_history == SCORE_MAX)
|
||||||
|
WP(w, highscore_d).background_img = SPR_TYCOON_IMG2_BEGIN;
|
||||||
|
}
|
||||||
|
|
||||||
/* In a network game show the endscores of the custom difficulty 'network' which is the last one
|
/* In a network game show the endscores of the custom difficulty 'network' which is the last one
|
||||||
* as well as generate a TOP5 of that game, and not an all-time top5 */
|
* as well as generate a TOP5 of that game, and not an all-time top5. */
|
||||||
w->window_number = (!_networking) ? _opt.diff_level : lengthof(_highscore_table) - 1;
|
if (_networking) {
|
||||||
WP(w, highscore_d).background_img = (p->old_economy[0].performance_history == SCORE_MAX) ? SPR_TYCOON_IMG2_BEGIN : SPR_TYCOON_IMG1_BEGIN; // which background to show
|
w->window_number = lengthof(_highscore_table) - 1;
|
||||||
WP(w, highscore_d).rank = (!_networking) ? SaveHighScoreValue(p) : SaveHighScoreValueNetwork();
|
WP(w, highscore_d).rank = SaveHighScoreValueNetwork();
|
||||||
}
|
} else {
|
||||||
|
// in single player _local player is always valid
|
||||||
|
const Player *p = DEREF_PLAYER(_local_player);
|
||||||
|
w->window_number = _opt.diff_level;
|
||||||
|
WP(w, highscore_d).rank = SaveHighScoreValue(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue