mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-02 22:14:12 +00:00
WiiSave: In Import(), make sure the TMD exists or can be reinstalled before allowing save to be imported.
This commit is contained in:
parent
46e4c17db3
commit
700d53e00f
@ -40,6 +40,7 @@
|
||||
#include "Core/IOS/IOS.h"
|
||||
#include "Core/IOS/IOSC.h"
|
||||
#include "Core/IOS/Uids.h"
|
||||
#include "Core/WiiUtils.h"
|
||||
|
||||
namespace WiiSave
|
||||
{
|
||||
@ -475,6 +476,14 @@ bool Import(const std::string& data_bin_path, std::function<bool()> can_overwrit
|
||||
ERROR_LOG_FMT(CORE, "WiiSave::Import: Failed to read header");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!WiiUtils::EnsureTMDIsImported(*ios.GetFS(), *ios.GetES(), header->tid))
|
||||
{
|
||||
ERROR_LOG_FMT(CORE, "WiiSave::Import: Failed to find or import TMD for title {:16x}",
|
||||
header->tid);
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto nand = MakeNandStorage(ios.GetFS().get(), header->tid);
|
||||
if (nand->SaveExists() && !can_overwrite())
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user