summaryrefslogtreecommitdiff
path: root/src/highscore.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-12-06 21:11:42 +0100
committerMichael Lutz <michi@icosahedron.de>2020-12-27 13:19:25 +0100
commitdd138fc460dcbab37452e90ff070a31516994aa2 (patch)
tree170edd04094e997abe891858a8e4753071983fee /src/highscore.cpp
parent860c270c73048b4930ac8cbebcd60be746eb9782 (diff)
downloadopenttd-dd138fc460dcbab37452e90ff070a31516994aa2.tar.xz
Codechange: Stringify config file paths.
Diffstat (limited to 'src/highscore.cpp')
-rw-r--r--src/highscore.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/highscore.cpp b/src/highscore.cpp
index d8fe348fe..187df028b 100644
--- a/src/highscore.cpp
+++ b/src/highscore.cpp
@@ -20,7 +20,7 @@
#include "safeguards.h"
HighScore _highscore_table[SP_HIGHSCORE_END][5]; ///< various difficulty-settings; top 5
-char *_highscore_file; ///< The file to store the highscore data in.
+std::string _highscore_file; ///< The file to store the highscore data in.
static const StringID _endgame_perf_titles[] = {
STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN,
@@ -123,7 +123,7 @@ int8 SaveHighScoreValueNetwork()
/** Save HighScore table to file */
void SaveToHighScore()
{
- FILE *fp = fopen(_highscore_file, "wb");
+ FILE *fp = fopen(_highscore_file.c_str(), "wb");
if (fp != nullptr) {
uint i;
@@ -151,7 +151,7 @@ void SaveToHighScore()
/** Initialize the highscore table to 0 and if any file exists, load in values */
void LoadFromHighScore()
{
- FILE *fp = fopen(_highscore_file, "rb");
+ FILE *fp = fopen(_highscore_file.c_str(), "rb");
memset(_highscore_table, 0, sizeof(_highscore_table));