PINK: Use the actual target when searching for saves

This ensures consistent behavior between listing and loading of saves
This commit is contained in:
Henrik "Henke37" Andersson 2022-08-03 17:12:00 +02:00 committed by Eugene Sandulenko
parent 18226bf92f
commit bd7f77e126
2 changed files with 4 additions and 3 deletions

View File

@ -146,9 +146,9 @@ struct SaveStateDescriptorTimeComparator {
}
};
static SaveStateList listSaves(bool isPeril) {
SaveStateList PinkEngine::listSaves() const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
Common::String pattern = isPeril ? "peril.s##" : "pokus.s##";
Common::String pattern = getMetaEngine()->getSavegameFile(kSavegameFilePattern, _targetName.c_str());
Common::StringArray filenames = saveFileMan->listSavefiles(pattern);
SaveStateList saveList;
@ -179,7 +179,7 @@ void PinkEngine::initMenu() {
Graphics::MacMenuSubMenu *subMenu = _menu->getSubmenu(nullptr, 0);
if (subMenu) {
SaveStateList saves = listSaves(isPeril());
SaveStateList saves = listSaves();
if (!saves.empty()) {
_menu->removeMenuItem(subMenu, kRecentSaveId);
int maxSaves = saves.size() > kMaxSaves ? kMaxSaves : saves.size();

View File

@ -105,6 +105,7 @@ public:
Common::String getSaveStateName(int slot) const override {
return Common::String::format("%s.s%02d", _targetName.c_str(), slot);
}
SaveStateList listSaves() const;
friend class Console;