yet another fix to racing

This commit is contained in:
Zeno Rogue 2022-08-07 15:01:28 +02:00
parent ce8e3c8640
commit e686f5bc39
1 changed files with 4 additions and 1 deletions

View File

@ -1265,7 +1265,10 @@ EX void loadsave() {
int land, score;
sscanf(buf, "%70s%9s%d%d", buf1, ver, &land, &score);
/* score may equal 0 because of earlier bugs */
if(score) racing::best_scores[eLand(land)] = score;
if(score) {
auto& res = racing::best_scores[eLand(land)];
if(score < res || res == 0) res = score;
}
println(hlog, "loaded the score for ", dnameof(eLand(land)), " of ", score);
}
#endif