From 858c47dc6ea9730819eaa5ca2d77cb8c476f2bbc Mon Sep 17 00:00:00 2001 From: Callow Date: Wed, 13 Jul 2022 11:36:47 +0300 Subject: [PATCH] #237 little code imporvements --- cheat-library/src/user/cheat/player/AutoRun.cpp | 15 +++++---------- cheat-library/src/user/cheat/player/AutoRun.h | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cheat-library/src/user/cheat/player/AutoRun.cpp b/cheat-library/src/user/cheat/player/AutoRun.cpp index cc3da23..66b5ef2 100644 --- a/cheat-library/src/user/cheat/player/AutoRun.cpp +++ b/cheat-library/src/user/cheat/player/AutoRun.cpp @@ -33,6 +33,7 @@ namespace cheat::feature { return f_Enabled; } + void AutoRun::DrawStatus() { ImGui::Text("Auto Run[%.01f]",f_Speed.value()); @@ -44,7 +45,7 @@ namespace cheat::feature return instance; } - void enableAutoRun(float speed) { + void EnableAutoRun(float speed) { auto& manager = game::EntityManager::instance(); auto avatarEntity = manager.avatar(); @@ -52,13 +53,7 @@ namespace cheat::feature auto baseMove = avatarEntity->moveComponent(); auto rigidBody = avatarEntity->rigidbody(); - if (baseMove == nullptr) - return; - - if (rigidBody == nullptr) - return; - - if (renderer::IsInputLocked()) + if (baseMove == nullptr || rigidBody == nullptr || renderer::IsInputLocked()) return; auto cameraEntity = game::Entity(reinterpret_cast(manager.mainCamera())); @@ -76,7 +71,7 @@ namespace cheat::feature void AutoRun::OnGameUpdate() { if (f_Enabled) { float speed = f_Speed.value(); - enableAutoRun(speed); + EnableAutoRun(speed); } } -} \ No newline at end of file +} diff --git a/cheat-library/src/user/cheat/player/AutoRun.h b/cheat-library/src/user/cheat/player/AutoRun.h index 6943018..f515ca8 100644 --- a/cheat-library/src/user/cheat/player/AutoRun.h +++ b/cheat-library/src/user/cheat/player/AutoRun.h @@ -24,4 +24,4 @@ namespace cheat::feature private: AutoRun(); }; -} \ No newline at end of file +}