(svn r25513) -Fix [FS#5623]: the high score's company/president name was stored with encoded string codes, causing it to cause trouble when the encoding of the string codes changes. Furthermore, check the incoming dangerous content better

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 11 years ago
parent 66b7123ed9
commit bdb62c14e2

@ -172,7 +172,7 @@ void LoadFromHighScore()
i = SP_SAVED_HIGHSCORE_END;
break;
}
*lastof(hs->company) = '\0';
str_validate(hs->company, lastof(hs->company), SVS_NONE);
hs->title = EndGameGetPerformanceTitleFromValue(hs->score);
}
}

@ -190,7 +190,8 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
if (hs[i].company[0] != '\0') {
TextColour colour = (this->rank == i) ? TC_RED : TC_BLACK; // draw new highscore in red
DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + (i * 55), hs[i].company, colour);
SetDParamStr(0, hs[i].company);
DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + (i * 55), STR_JUST_BIG_RAW_STRING, colour);
SetDParam(0, hs[i].title);
SetDParam(1, hs[i].score);
DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + FONT_HEIGHT_LARGE + (i * 55), STR_HIGHSCORE_STATS, colour);

@ -663,7 +663,7 @@ STR_HIGHSCORE_PERFORMANCE_TITLE_CAPITALIST :Capitalist
STR_HIGHSCORE_PERFORMANCE_TITLE_MAGNATE :Magnate
STR_HIGHSCORE_PERFORMANCE_TITLE_MOGUL :Mogul
STR_HIGHSCORE_PERFORMANCE_TITLE_TYCOON_OF_THE_CENTURY :Tycoon of the Century
STR_HIGHSCORE_NAME :{BIG_FONT}{PRESIDENT_NAME}, {COMPANY}
STR_HIGHSCORE_NAME :{PRESIDENT_NAME}, {COMPANY}
STR_HIGHSCORE_STATS :{BIG_FONT}'{STRING}' ({COMMA})
STR_HIGHSCORE_COMPANY_ACHIEVES_STATUS :{BIG_FONT}{BLACK}{COMPANY} achieves '{STRING}' status!
STR_HIGHSCORE_PRESIDENT_OF_COMPANY_ACHIEVES_STATUS :{BIG_FONT}{WHITE}{PRESIDENT_NAME} of {COMPANY} achieves '{STRING}' status!
@ -4817,6 +4817,7 @@ STR_JUST_DATE_ISO :{DATE_ISO}
STR_JUST_STRING :{STRING}
STR_JUST_STRING_STRING :{STRING}{STRING}
STR_JUST_RAW_STRING :{RAW_STRING}
STR_JUST_BIG_RAW_STRING :{BIG_FONT}{RAW_STRING}
# Slightly 'raw' stringcodes with colour or size
STR_BLACK_COMMA :{BLACK}{COMMA}

Loading…
Cancel
Save