Fixed unable to sprint issue

This commit is contained in:
Andrei Abrudan 2022-06-29 21:11:17 +01:00
parent fc657f144c
commit 4057abcc2c

View File

@ -27,8 +27,8 @@ namespace cheat::feature
ConfigWidget("Enabled", f_Enabled, "Enables infinite stamina option."); ConfigWidget("Enabled", f_Enabled, "Enables infinite stamina option.");
ConfigWidget("Move Sync Packet Replacement", f_PacketReplacement, ConfigWidget("Move Sync Packet Replacement", f_PacketReplacement,
"This mode prevents sending server packets with stamina cost actions,\n" \ "This mode prevents sending server packets with stamina cost actions,\n"
"e.g. swim, climb, sprint, etc.\n" \ "e.g. swim, climb, sprint, etc.\n"
"NOTE: This is may be more safe than the standard method. More testing is needed."); "NOTE: This is may be more safe than the standard method. More testing is needed.");
} }
@ -55,11 +55,19 @@ namespace cheat::feature
bool InfiniteStamina::OnPropertySet(app::PropType__Enum propType) bool InfiniteStamina::OnPropertySet(app::PropType__Enum propType)
{ {
using PT = app::PropType__Enum; using PT = app::PropType__Enum;
static bool max_stamina = true;
return !f_Enabled || f_PacketReplacement || const bool result = !f_Enabled || f_PacketReplacement || max_stamina ||
(propType != PT::PROP_MAX_STAMINA && (propType != PT::PROP_MAX_STAMINA &&
propType != PT::PROP_CUR_PERSIST_STAMINA && propType != PT::PROP_CUR_PERSIST_STAMINA &&
propType != PT::PROP_CUR_TEMPORARY_STAMINA); propType != PT::PROP_CUR_TEMPORARY_STAMINA);
if (propType == PT::PROP_PLAYER_LEVEL)
max_stamina = true;
if (propType == PT::PROP_MAX_STAMINA)
max_stamina = false;
return result;
} }
// Infinite stamina packet mode. // Infinite stamina packet mode.