From 13034eff056aef8a105f70409548ca213ef16d4d Mon Sep 17 00:00:00 2001 From: nosoop Date: Fri, 25 Nov 2022 08:47:11 -0800 Subject: [PATCH] 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. (cherry picked from commit 34c8220e5d650f682674e8b7b3e77f63934e8b41) --- core/logic/GameConfigs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/logic/GameConfigs.cpp b/core/logic/GameConfigs.cpp index 7aae9ee8..43444e19 100644 --- a/core/logic/GameConfigs.cpp +++ b/core/logic/GameConfigs.cpp @@ -810,7 +810,10 @@ public: (!had_game && matched_engine) || (matched_engine && matched_game)) { - fileList->push_back(cur_file); + if (fileList->find(cur_file) == fileList->end()) + { + fileList->push_back(cur_file); + } } state = MSTATE_MAIN; }