mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
WiiSave: In Import(), make sure the TMD exists or can be reinstalled before allowing save to be imported.
This commit is contained in:
@ -40,6 +40,7 @@
|
|||||||
#include "Core/IOS/IOS.h"
|
#include "Core/IOS/IOS.h"
|
||||||
#include "Core/IOS/IOSC.h"
|
#include "Core/IOS/IOSC.h"
|
||||||
#include "Core/IOS/Uids.h"
|
#include "Core/IOS/Uids.h"
|
||||||
|
#include "Core/WiiUtils.h"
|
||||||
|
|
||||||
namespace WiiSave
|
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");
|
ERROR_LOG_FMT(CORE, "WiiSave::Import: Failed to read header");
|
||||||
return false;
|
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);
|
const auto nand = MakeNandStorage(ios.GetFS().get(), header->tid);
|
||||||
if (nand->SaveExists() && !can_overwrite())
|
if (nand->SaveExists() && !can_overwrite())
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user