From 4142a34ebd7192afbf49022d678143ba24404871 Mon Sep 17 00:00:00 2001 From: Andrei Abrudan Date: Thu, 30 Jun 2022 20:31:07 +0100 Subject: [PATCH] More modifications to make cheat independent of other propTypes --- .../src/user/cheat/player/InfiniteStamina.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cheat-library/src/user/cheat/player/InfiniteStamina.cpp b/cheat-library/src/user/cheat/player/InfiniteStamina.cpp index 57e57b9..2278385 100644 --- a/cheat-library/src/user/cheat/player/InfiniteStamina.cpp +++ b/cheat-library/src/user/cheat/player/InfiniteStamina.cpp @@ -55,17 +55,18 @@ namespace cheat::feature bool InfiniteStamina::OnPropertySet(app::PropType__Enum propType) { using PT = app::PropType__Enum; - static bool max_stamina = true; + static bool override_cheat = true; - const bool result = !f_Enabled || f_PacketReplacement || max_stamina || - (propType != PT::PROP_MAX_STAMINA && - propType != PT::PROP_CUR_PERSIST_STAMINA && - propType != PT::PROP_CUR_TEMPORARY_STAMINA); + if (propType == PT::PROP_CUR_TEMPORARY_STAMINA) + override_cheat = true; + + const bool result = !f_Enabled || f_PacketReplacement || override_cheat || + (propType != PT::PROP_MAX_STAMINA && + propType != PT::PROP_CUR_PERSIST_STAMINA && + propType != PT::PROP_CUR_TEMPORARY_STAMINA); - if (propType == PT::PROP_PLAYER_WORLD_LEVEL_LIMIT) - max_stamina = true; if (propType == PT::PROP_MAX_STAMINA) - max_stamina = false; + override_cheat = false; return result; }