Fixed enemies not freezing(elemental reaction)

This commit is contained in:
Joaquin 2022-08-01 00:29:35 -06:00
parent 1f9d79d207
commit a13bde4367
2 changed files with 8 additions and 1 deletions

View File

@ -346,6 +346,7 @@ DO_APP_FUNC(0x0579EB00, int32_t, Screen_get_height, (MethodInfo* method));
DO_APP_FUNC(0x05822EE0, void, Animator_Play, (Animator* __this, String* stateName, int32_t layer, float normalizedTime, MethodInfo* method)); DO_APP_FUNC(0x05822EE0, void, Animator_Play, (Animator* __this, String* stateName, int32_t layer, float normalizedTime, MethodInfo* method));
DO_APP_FUNC(0x05823060, void, Animator_Rebind, (Animator* __this, MethodInfo* method)); DO_APP_FUNC(0x05823060, void, Animator_Rebind, (Animator* __this, MethodInfo* method));
DO_APP_FUNC(0x058235C0, float, Animator_get_speed, (Animator* __this, MethodInfo* method));
DO_APP_FUNC(0x058236F0, void, Animator_set_speed, (Animator* __this, float value, MethodInfo* method)); DO_APP_FUNC(0x058236F0, void, Animator_set_speed, (Animator* __this, float value, MethodInfo* method));
DO_APP_FUNC(0x058AE2D0, bool, Behaviour_get_isActiveAndEnabled, (Behaviour* __this, MethodInfo* method)); DO_APP_FUNC(0x058AE2D0, bool, Behaviour_get_isActiveAndEnabled, (Behaviour* __this, MethodInfo* method));

View File

@ -9,6 +9,7 @@
namespace cheat::feature namespace cheat::feature
{ {
static bool change = false;
FreezeEnemies::FreezeEnemies() : Feature(), FreezeEnemies::FreezeEnemies() : Feature(),
NF(f_Enabled, "Freeze Enemies", "FreezeEnemies", false) NF(f_Enabled, "Freeze Enemies", "FreezeEnemies", false)
@ -61,11 +62,16 @@ namespace cheat::feature
//LOG_DEBUG("%s", magic_enum::enum_name(constraints).data()); //LOG_DEBUG("%s", magic_enum::enum_name(constraints).data());
app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezeAll, nullptr); app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezeAll, nullptr);
app::Animator_set_speed(animator, 0.f, nullptr); app::Animator_set_speed(animator, 0.f, nullptr);
change = false;
} }
else else
{ {
app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezeRotation, nullptr); app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezeRotation, nullptr);
app::Animator_set_speed(animator, 1.f, nullptr); if (!change)
{
app::Animator_set_speed(animator, 1.f, nullptr);
change = true;
}
} }
} }
} }