From 89be4b252d663e34cd030ea01a5e11b40a2bf4d7 Mon Sep 17 00:00:00 2001 From: FreezeEngine Date: Thu, 1 Aug 2024 21:46:09 +0300 Subject: [PATCH] No hurt cam fix --- .../Module/Modules/NoHurtCam/NoHurtCamListener.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Client/Module/Modules/NoHurtCam/NoHurtCamListener.hpp b/src/Client/Module/Modules/NoHurtCam/NoHurtCamListener.hpp index 0c54b685..53f61141 100644 --- a/src/Client/Module/Modules/NoHurtCam/NoHurtCamListener.hpp +++ b/src/Client/Module/Modules/NoHurtCam/NoHurtCamListener.hpp @@ -49,21 +49,27 @@ class NoHurtCamListener : public Listener { } void onTick(TickEvent &event) override { - if (module->isEnabled() && !module->restricted) { + if (!module->restricted) { patch(); } else { unpatch(); } } + void onUnregister() override { + unpatch(); + } + NoHurtCamListener(const char string[5], Module *module) { this->name = string; this->module = module; originalCameraAngle.resize(3); - sigOffset = Memory::findSig(GET_SIG("CameraAssignAngle")) + 4; + if(sigOffset == NULL) { + sigOffset = Memory::findSig(GET_SIG("CameraAssignAngle")) + 4; + } - memcpy(originalCameraAngle.data(), (LPVOID) sigOffset, 3); + Memory::patchBytes( originalCameraAngle.data(), (LPVOID)sigOffset, 3); } }; \ No newline at end of file