From e5d7d24d0d96b32ccd263ba755d0d0d473c6618d Mon Sep 17 00:00:00 2001 From: praydog Date: Tue, 26 Mar 2024 19:29:00 -0700 Subject: [PATCH] DD2: Spoof DLLs at additional points to fix crashes --- src/Main.cpp | 2 ++ src/REFramework.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index e5c3b03c2..6e9743ba1 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -76,6 +76,8 @@ void startup_thread(HMODULE reframework_module) { utility::spoof_module_paths_in_exe_dir(); utility::unlink(*our_dll); } +#elif defined (DD2) + utility::spoof_module_paths_in_exe_dir(); #endif } } diff --git a/src/REFramework.cpp b/src/REFramework.cpp index ba341f7cb..e6f8a375d 100644 --- a/src/REFramework.cpp +++ b/src/REFramework.cpp @@ -1556,7 +1556,7 @@ bool REFramework::initialize_game_data() { std::scoped_lock _{this->m_startup_mutex}; try { -#if defined(MHRISE) +#if defined(MHRISE) || defined(DD2) utility::spoof_module_paths_in_exe_dir(); #endif reframework::initialize_sdk(); @@ -1623,7 +1623,7 @@ bool REFramework::initialize_game_data() { spdlog::error("Initialization of mods failed. Reason: exception thrown."); } -#if defined(MHRISE) +#if defined(MHRISE) || defined(DD2) utility::spoof_module_paths_in_exe_dir(); #endif spdlog::info("Game data initialization thread finished");