diff --git a/Source/Installer/Installer.iss b/Source/Installer/Installer.iss index 1afac9fab..2e318eb3f 100644 --- a/Source/Installer/Installer.iss +++ b/Source/Installer/Installer.iss @@ -44,6 +44,7 @@ Source: "{#BaseDir}\apidoc.htm"; DestDir: "{app}" [Dirs] Name: "{app}\Config"; Permissions: everyone-full +Name: "{app}\Config\Cheats-User"; Permissions: everyone-full Name: "{app}\Logs"; Permissions: everyone-full Name: "{app}\Save"; Permissions: everyone-full Name: "{app}\Screenshots"; Permissions: everyone-full diff --git a/Source/Project64-core/N64System/Enhancement/Enhancements.cpp b/Source/Project64-core/N64System/Enhancement/Enhancements.cpp index cc9e59f5e..cf6b8b461 100644 --- a/Source/Project64-core/N64System/Enhancement/Enhancements.cpp +++ b/Source/Project64-core/N64System/Enhancement/Enhancements.cpp @@ -91,6 +91,10 @@ void CEnhancements::UpdateCheats(const CEnhancementList & Cheats) CGuard Guard(m_CS); if (strcmp(m_CheatFile->FileName(), OutFile) != 0) { + if (!OutFile.DirectoryExists()) + { + OutFile.DirectoryCreate(); + } SectionFiles::const_iterator CheatFileItr = m_CheatFiles.find(m_SectionIdent); if (m_CheatFiles.end() != CheatFileItr) { @@ -156,6 +160,7 @@ void CEnhancements::LoadCheats(CMipsMemoryVM * MMU) WaitScanDone(); CGuard Guard(m_CS); SectionFiles::const_iterator CheatFileItr = m_CheatFiles.find(m_SectionIdent); + bool FoundFile = false; if (CheatFileItr != m_CheatFiles.end()) { CPath CheatFile(CheatFileItr->second); @@ -163,9 +168,15 @@ void CEnhancements::LoadCheats(CMipsMemoryVM * MMU) { m_CheatFile = std::make_unique(CheatFile, "Cheat"); m_CheatFile->GetEnhancementList(m_SectionIdent.c_str(), m_Cheats); + FoundFile = true; } } + if (!FoundFile) + { + m_CheatFile = nullptr; + m_Cheats.clear(); + } ResetCodes(MMU); for (CEnhancementList::const_iterator itr = m_Cheats.begin(); itr != m_Cheats.end(); itr++) { diff --git a/Source/Script/package_zip.cmd b/Source/Script/package_zip.cmd index 5270e4261..be72728d7 100644 --- a/Source/Script/package_zip.cmd +++ b/Source/Script/package_zip.cmd @@ -30,6 +30,7 @@ IF %ERRORLEVEL% NEQ 0 GOTO EndErr rd "%base_dir%\Bin\Package" /Q /S > NUL 2>&1 md "%base_dir%\Bin\Package" md "%base_dir%\Bin\Package\Config" +md "%base_dir%\Bin\Package\Config\Cheats" md "%base_dir%\Bin\Package\Lang" md "%base_dir%\Bin\Package\Plugin%VSPlatform%" md "%base_dir%\Bin\Package\Plugin%VSPlatform%\Audio"