From abac039ec8624e1b1c32bd0363e6d628915ca124 Mon Sep 17 00:00:00 2001 From: Explodingbill Date: Thu, 29 Aug 2024 16:24:52 +1000 Subject: [PATCH] g --- changelog.md | 1 + src/Hacks/NoCheckpointLimit.cpp | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index e77bfec..a6a423f 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ - Fixed infamous all modes platformer crash - Fixed Hitbox Trail saving the trail when show hitboxes is disabled - Fixed Show Hitboxes not working if prism menu is enabled +- Fixed incompatibility with XDBot rewrite - Lowered Max Hitbox Trail count to 200 instead of 500 for performance reasons - Added **Decimals to Best Run** - Added **Hide From % from 0 to Best Run** diff --git a/src/Hacks/NoCheckpointLimit.cpp b/src/Hacks/NoCheckpointLimit.cpp index c9c4ad5..cadf8f1 100644 --- a/src/Hacks/NoCheckpointLimit.cpp +++ b/src/Hacks/NoCheckpointLimit.cpp @@ -6,12 +6,36 @@ using namespace geode::prelude; class $modify (PlayLayer) { + static void onModify(auto& self) { + self.setHookPriority("PlayLayer::storeCheckpoint", 99999999999999999); + + std::vector hooks; + + if (self.m_hooks.empty()) + return; + + for (auto hook : self.m_hooks) + { + hooks.push_back(hook.second.get()); + } + + Loader::get()->queueInMainThread([hooks] + { + auto modu = Client::GetModule("no-checkpoint-limit"); + for (auto hook : hooks) + { + if (hook) + { + modu->addHook(hook); + } + } + }); + } + void storeCheckpoint(CheckpointObject* cp) { m_checkpointArray->addObject(cp); PlayLayer::addToSection(cp->m_physicalCheckpointObject); } - - QOLMOD_MOD_ALL_HOOKS("no-checkpoint-limit") };