Do not necessary reload enhancement file

This commit is contained in:
zilmar 2021-02-23 21:39:48 +10:30
parent 998ff9ea2a
commit 155d331d45
1 changed files with 4 additions and 1 deletions

View File

@ -235,8 +235,11 @@ void CEnhancements::LoadEnhancements(const char * Ident, SectionFiles & Files, s
{ {
CPath CheatFile(CheatFileItr->second); CPath CheatFile(CheatFileItr->second);
if (CheatFile.Exists()) if (CheatFile.Exists())
{
if (File.get() == nullptr || strcmp(File->FileName(), CheatFile) != 0)
{ {
File = std::make_unique<CEnhancmentFile>(CheatFile, Ident); File = std::make_unique<CEnhancmentFile>(CheatFile, Ident);
}
File->GetEnhancementList(SectionIdent.c_str(), EnhancementList); File->GetEnhancementList(SectionIdent.c_str(), EnhancementList);
FoundFile = true; FoundFile = true;
} }