Ensure gameconfig file uniqueness when reading master.games (#1859)

The extended gameconfig format reads the master gameconf file twice;
once each for the base engine and actual engine.  The file list
isn't checked for duplicates, so 'common.games.txt' is loaded in
twice, resulting in any 'common' file values potentially overriding
values listed under '#default' in other files due to
bShouldBeReadingDefault.  This happens in the case when matching
game versions by CRC (such as public game branches).

Required for #1857.
This commit is contained in:
nosoop 2022-11-25 08:47:11 -08:00 committed by GitHub
parent 3595525f12
commit 34c8220e5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -813,9 +813,12 @@ public:
(!had_engine && matched_game) || (!had_engine && matched_game) ||
(!had_game && matched_engine) || (!had_game && matched_engine) ||
(matched_engine && matched_game)) (matched_engine && matched_game))
{
if (fileList->find(cur_file) == fileList->end())
{ {
fileList->push_back(cur_file); fileList->push_back(cur_file);
} }
}
state = MSTATE_MAIN; state = MSTATE_MAIN;
} }
else if (state == MSTATE_MAIN) else if (state == MSTATE_MAIN)