Jelajahi Sumber

core: Initialize cheats after load to avoid VMManager crash

This used to occur due to the VMManager being nullptr at the time cheats were registered (during load, but before it was done). This is bypassed by not accessing the VMManager for offset data until load is complete,
Zach Hilman 7 tahun lalu
induk
melakukan
3e729c13cc
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      src/core/core.cpp

+ 5 - 0
src/core/core.cpp

@@ -205,6 +205,11 @@ struct System::Impl {
         gpu_core->Start();
         gpu_core->Start();
         cpu_core_manager.StartThreads();
         cpu_core_manager.StartThreads();
 
 
+        // Initialize cheat engine
+        if (cheat_engine) {
+            cheat_engine->Initialize();
+        }
+
         // All threads are started, begin main process execution, now that we're in the clear.
         // All threads are started, begin main process execution, now that we're in the clear.
         main_process->Run(load_parameters->main_thread_priority,
         main_process->Run(load_parameters->main_thread_priority,
                           load_parameters->main_thread_stack_size);
                           load_parameters->main_thread_stack_size);