From 46789e68dfddb79d78c1617896046ce73ea8e154 Mon Sep 17 00:00:00 2001 From: PADO <62028267+47PADO47@users.noreply.github.com> Date: Fri, 9 Feb 2024 16:43:10 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=20=20Use=20UpdatePlayerHealth=20to=20?= =?UTF-8?q?handle=20GodMode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Internal/cheat/Features.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Internal/cheat/Features.h b/Internal/cheat/Features.h index 104d151..3e2b887 100644 --- a/Internal/cheat/Features.h +++ b/Internal/cheat/Features.h @@ -43,12 +43,8 @@ class Features { else if (!collision && !Player->GetActorEnableCollision()) Player->SetActorEnableCollision(true); - if (Settings.EXPLOITS.GodMode && Player->Health != 0) { - float health = 999999; - if (Player->MaxHealth != health) Player->MaxHealth = health; - if (Player->Health != health) Player->Health = health; - - //Instigator->healthRechargeDelay = 0.1f; + if (Player->Health != 0) { + UpdatePlayerHealth(Player); }; if (Settings.EXPLOITS.SpinBot && Mesh) { @@ -74,4 +70,25 @@ class Features { if (rpc->GetState() == state) return; return rpc->UpdateState(state); } + + void UpdatePlayerHealth(APawn* Player) { + if (Settings.EXPLOITS.GodMode) { + float health = 999999; + if (Player->MaxHealth != health) Player->MaxHealth = health; + if (Player->Health != health) Player->Health = health; + + //Instigator->healthRechargeDelay = 0.1f; + + return; + } + + if (Player->Health > 100) { + Player->MaxHealth = 100; + Player->Health = 100; + + return; + } + + return; + } }; \ No newline at end of file