From 5cbe8594612d38ef79cfbf95a1b9762d47437238 Mon Sep 17 00:00:00 2001 From: maxnut <54683950+maxnut@users.noreply.github.com> Date: Sat, 27 Jan 2024 17:05:59 +0100 Subject: [PATCH] unfuck noclip accuracy --- src/Hacks/Labels.cpp | 36 ++++++++++++++++++------------------ src/Hacks/Labels.h | 4 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Hacks/Labels.cpp b/src/Hacks/Labels.cpp index a8c5196..3834ea9 100644 --- a/src/Hacks/Labels.cpp +++ b/src/Hacks/Labels.cpp @@ -138,10 +138,10 @@ class $modify(PlayLayer) void destroyPlayer(PlayerObject* player, GameObject* object) { - if (totalDelta > 0.1f) - dead = true; - PlayLayer::destroyPlayer(player, object); + + if(frames > 60) + dead = true; } void resetLevel() @@ -151,15 +151,21 @@ class $modify(PlayLayer) totalClicks = 0; frames = 0; deaths = 0; - totalDelta = 0; realDeaths = 0; clicks.clear(); PlayLayer::resetLevel(); } - void postUpdate(float dt) + void onQuit() { - if (labelsCreated) + labels.clear(); + PlayLayer::onQuit(); + } +}; + +void Labels::GJBaseGameLayerProcessCommands(GJBaseGameLayer *self) +{ + if (labelsCreated) { for (Label& l : labels) l.process(); @@ -169,9 +175,6 @@ class $modify(PlayLayer) frames++; - if (MBO(double, GameManager::get()->getPlayLayer(), 0x583) > 0) - totalDelta += dt; - if(dead) { deaths++; @@ -182,16 +185,13 @@ class $modify(PlayLayer) lastFrameDead = dead; dead = false; + reinterpret_cast(base::get() + 0x1BD240)(self); +} - PlayLayer::postUpdate(dt); - } - - void onQuit() - { - labels.clear(); - PlayLayer::onQuit(); - } -}; +$execute +{ + Mod::get()->hook(reinterpret_cast(base::get() + 0x1BD240), &GJBaseGameLayerProcessCommands, "GJBaseGameLayer::processCommands", tulip::hook::TulipConvention::Thiscall); +} class $modify(PlayerObject) { diff --git a/src/Hacks/Labels.h b/src/Hacks/Labels.h index f22f2bf..1c056bf 100644 --- a/src/Hacks/Labels.h +++ b/src/Hacks/Labels.h @@ -33,8 +33,6 @@ inline size_t frames = 0; inline size_t deaths = 0; inline size_t realDeaths = 0; -inline float totalDelta = 0; - inline bool clickRegistered = false; inline bool labelsCreated = false; inline bool click = false; @@ -47,6 +45,8 @@ Label setupLabel(const std::string& labelSettingName, const std::functionextraSettings); void renderWindow(); } // namespace Labels \ No newline at end of file