From c1138a535429b2c437d7c6fd703d013eaf2982aa Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Sun, 2 Oct 2022 14:54:31 +0200 Subject: [PATCH] add: unlimited UV nullptr check --- DevourClient/Features/Misc/Misc.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/DevourClient/Features/Misc/Misc.cpp b/DevourClient/Features/Misc/Misc.cpp index 276be76..5efaef4 100644 --- a/DevourClient/Features/Misc/Misc.cpp +++ b/DevourClient/Features/Misc/Misc.cpp @@ -1,4 +1,5 @@ #include "Misc.hpp" +#include "../../Utils/Output/Output.hpp" void Misc::SetRank(int rank) { Players::LocalPlayer->GetComponent("NolanRankController")->CallMethodSafe("SetRank", rank); @@ -20,13 +21,18 @@ void Misc::WalkInlobby(bool walk) { void Misc::UnlimitedUV(bool active) { try { - Players::LocalPlayer->GetComponent("NolanBehaviour")->CallMethodSafe("SetPurgatory", active); + Unity::CComponent* NolanBehaviour = Players::LocalPlayer->GetComponent("NolanBehaviour"); + if (!NolanBehaviour) { + return; + } + NolanBehaviour->CallMethodSafe("SetPurgatory", active); } catch (...) { settings::unlimited_uv = false; - std::cout << "Unlimited UV error"; + print("Unlimited UV error"); } } + void Misc::SetSteamName(std::string name) { Unity::CGameObject* MenuController = Unity::GameObject::Find("MenuController"); if (!MenuController) {