Skip to content

Commit

Permalink
♻ Use UpdatePlayerHealth to handle GodMode
Browse files Browse the repository at this point in the history
  • Loading branch information
47PADO47 committed Feb 9, 2024
1 parent 6e2bd34 commit 46789e6
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions Internal/cheat/Features.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
};

0 comments on commit 46789e6

Please sign in to comment.