Changeset - r20492:cef2e626fdc1
[Not reviewed]
master
0 3 0
rubidium - 11 years ago 2013-06-29 12:09:55
rubidium@openttd.org
(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
3 files changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/highscore.cpp
Show inline comments
 
@@ -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);
 
			}
 
		}
src/highscore_gui.cpp
Show inline comments
 
@@ -190,7 +190,8 @@ struct HighScoreWindow : EndGameHighScor
 
			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);
src/lang/english.txt
Show inline comments
 
@@ -663,7 +663,7 @@ STR_HIGHSCORE_PERFORMANCE_TITLE_CAPITALI
 
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                       
 
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}
0 comments (0 inline, 0 general)