Browse Source

fx

pull/3223/head
lizzie 1 month ago
parent
commit
dff3921495
  1. 6
      src/core/memory/cheat_engine.cpp

6
src/core/memory/cheat_engine.cpp

@ -226,14 +226,16 @@ CheatEngine::CheatEngine(System& system_, std::vector<CheatEntry> cheats_,
} }
CheatEngine::~CheatEngine() { CheatEngine::~CheatEngine() {
if (event)
core_timing.UnscheduleEvent(event); core_timing.UnscheduleEvent(event);
else
LOG_ERROR(CheatEngine, "~CheatEngine before event was registered");
} }
void CheatEngine::Initialize() { void CheatEngine::Initialize() {
event = Core::Timing::CreateEvent( event = Core::Timing::CreateEvent(
"CheatEngine::FrameCallback::" + Common::HexToString(metadata.main_nso_build_id), "CheatEngine::FrameCallback::" + Common::HexToString(metadata.main_nso_build_id),
[this](s64 time,
std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> {
[this](s64 time, std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> {
FrameCallback(ns_late); FrameCallback(ns_late);
return std::nullopt; return std::nullopt;
}); });

Loading…
Cancel
Save