Correctly load seeds

This commit is contained in:
zhupengfei
2020-05-01 15:05:01 +08:00
parent f60fc572be
commit 2c4dd84d49
3 changed files with 8 additions and 8 deletions
+3 -7
View File
@@ -119,17 +119,13 @@ namespace Seeds {
static SeedDB g_seeddb;
static bool g_seeddb_loaded = false;
void Init(bool force) {
if (force || !g_seeddb_loaded) {
g_seeddb.Load(
fmt::format("{}/seeddb.bin", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)));
}
g_seeddb_loaded = true;
void Load(const std::string& path) {
g_seeddb_loaded = g_seeddb.Load(path);
}
std::optional<Seed::Data> GetSeed(u64 title_id) {
if (!g_seeddb_loaded) {
Init();
Load(fmt::format("{}/seeddb.bin", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)));
}
return g_seeddb.Get(title_id);
}