mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 05:23:04 +01:00
Merge pull request #3385 from janisozaur/highscores
Don't parse invalid names from highscores fixes #3333
This commit is contained in:
@@ -92,6 +92,10 @@ int object_load_file(int groupIndex, const rct_object_entry *entry, int* chunkSi
|
||||
*chunkSize = sawyercoding_read_chunk(rw, chunk);
|
||||
}
|
||||
SDL_RWclose(rw);
|
||||
if (chunk == NULL) {
|
||||
log_error("Failed to load object from %s of size %d", path, *chunkSize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int calculatedChecksum = object_calculate_checksum(&openedEntry, chunk, *chunkSize);
|
||||
|
||||
|
||||
@@ -432,6 +432,9 @@ static bool scenario_scores_load()
|
||||
SDL_RWread(file, &highscore->timestamp, sizeof(highscore->timestamp), 1);
|
||||
|
||||
// Attach highscore to correct scenario entry
|
||||
if (highscore->fileName == NULL) {
|
||||
continue;
|
||||
}
|
||||
scenario_index_entry *scenarioIndexEntry = scenario_list_find_by_filename(highscore->fileName);
|
||||
if (scenarioIndexEntry != NULL) {
|
||||
scenarioIndexEntry->highscore = highscore;
|
||||
|
||||
Reference in New Issue
Block a user