From 5af2f3169cf468d40337cdb1e50f1ce660171571 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Sat, 1 Oct 2022 19:58:37 +0200 Subject: [PATCH] add: helper.cpp --- DevourClient/Callbacks/OnUpdate.cpp | 4 +++- DevourClient/Features/Misc/Misc.cpp | 12 ++++++++++++ DevourClient/Features/Misc/Misc.hpp | 2 +- DevourClient/Utils/Helpers/Helpers.cpp | 3 +++ DevourClient/Utils/Helpers/Helpers.hpp | 12 ++++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 DevourClient/Utils/Helpers/Helpers.cpp create mode 100644 DevourClient/Utils/Helpers/Helpers.hpp diff --git a/DevourClient/Callbacks/OnUpdate.cpp b/DevourClient/Callbacks/OnUpdate.cpp index 5676b04..3039227 100644 --- a/DevourClient/Callbacks/OnUpdate.cpp +++ b/DevourClient/Callbacks/OnUpdate.cpp @@ -8,9 +8,11 @@ #include "../Features/Misc/Misc.hpp" - void OnUpdate() { if (settings::spoof_level) { Misc::SetRank(settings::new_level); } + if (settings::walk_in_lobby) { + Misc::WalkInlobby(settings::walk_in_lobby); + } } \ No newline at end of file diff --git a/DevourClient/Features/Misc/Misc.cpp b/DevourClient/Features/Misc/Misc.cpp index 8b5ec8e..a6f8d5d 100644 --- a/DevourClient/Features/Misc/Misc.cpp +++ b/DevourClient/Features/Misc/Misc.cpp @@ -2,4 +2,16 @@ void Misc::SetRank(int rank) { Players::LocalPlayer->GetComponent("NolanRankController")->CallMethodSafe("SetRank", rank); +} + +void Misc::WalkInlobby(bool walk) { + Unity::CComponent* UltimateCharacterLocomotionHandler = Players::LocalPlayer->GetComponent("UltimateCharacterLocomotionHandler"); + + if (UltimateCharacterLocomotionHandler == NULL) + { + Players::LocalPlayer->AddComponent(IL2CPP::Class::GetSystemType("UltimateCharacterLocomotionHandler")); + Players::LocalPlayer->GetComponent("UltimateCharacterLocomotionHandler")->SetMemberValue("enabled", false); + } + + Players::LocalPlayer->GetComponent("UltimateCharacterLocomotionHandler")->SetMemberValue("enabled", walk); } \ No newline at end of file diff --git a/DevourClient/Features/Misc/Misc.hpp b/DevourClient/Features/Misc/Misc.hpp index cf3f356..e63dea7 100644 --- a/DevourClient/Features/Misc/Misc.hpp +++ b/DevourClient/Features/Misc/Misc.hpp @@ -6,6 +6,6 @@ #include namespace Misc { - void SetRank(int rank); + void WalkInlobby(bool walk); } \ No newline at end of file diff --git a/DevourClient/Utils/Helpers/Helpers.cpp b/DevourClient/Utils/Helpers/Helpers.cpp new file mode 100644 index 0000000..0d449bd --- /dev/null +++ b/DevourClient/Utils/Helpers/Helpers.cpp @@ -0,0 +1,3 @@ +#include "Helpers.hpp" + +//define functions the same as in misc.hpp/cpp \ No newline at end of file diff --git a/DevourClient/Utils/Helpers/Helpers.hpp b/DevourClient/Utils/Helpers/Helpers.hpp new file mode 100644 index 0000000..c82f25e --- /dev/null +++ b/DevourClient/Utils/Helpers/Helpers.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include "../Dependencies/IL2CPP_Resolver/il2cpp_resolver.hpp" +#include "../../Utils/Players/Players.hpp" +#include "../../Utils/Settings/Settings.hpp" +#include + + +//define functions the same as in misc.hpp/cpp +namespace Helpers { + +} \ No newline at end of file