From 39942dc4bdec205c424d107beab17cde35041af1 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Fri, 8 Jul 2022 00:40:18 -0700 Subject: [PATCH] disable FunctionCodeIndex during replays --- src/FunctionCompiler.hh | 6 ++++-- src/Main.cc | 14 +++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/FunctionCompiler.hh b/src/FunctionCompiler.hh index 1f83f553..e13edd28 100644 --- a/src/FunctionCompiler.hh +++ b/src/FunctionCompiler.hh @@ -41,7 +41,8 @@ std::shared_ptr compile_function_code( struct FunctionCodeIndex { - FunctionCodeIndex(const std::string& directory); + FunctionCodeIndex() = default; + explicit FunctionCodeIndex(const std::string& directory); std::unordered_map> name_to_function; std::unordered_map> index_to_function; @@ -67,7 +68,8 @@ struct DOLFileIndex { std::vector> item_id_to_file; std::map> name_to_file; - DOLFileIndex(const std::string& directory); + DOLFileIndex() = default; + explicit DOLFileIndex(const std::string& directory); std::vector menu() const; inline bool empty() const { diff --git a/src/Main.cc b/src/Main.cc index 7f6327ec..70e5d124 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -361,11 +361,15 @@ int main(int argc, char** argv) { config_log.info("Collecting quest metadata"); state->quest_index.reset(new QuestIndex("system/quests")); - config_log.info("Compiling client functions"); - state->function_code_index.reset(new FunctionCodeIndex("system/ppc")); - - config_log.info("Loading DOL files"); - state->dol_file_index.reset(new DOLFileIndex("system/dol")); + if (!replay_log_filename) { + config_log.info("Compiling client functions"); + state->function_code_index.reset(new FunctionCodeIndex("system/ppc")); + config_log.info("Loading DOL files"); + state->dol_file_index.reset(new DOLFileIndex("system/dol")); + } else { + state->function_code_index.reset(new FunctionCodeIndex()); + state->dol_file_index.reset(new DOLFileIndex()); + } config_log.info("Creating menus"); state->create_menus(config_json);