From a13bde436760293161df19903fb4a25d4d840d64 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Mon, 1 Aug 2022 00:29:35 -0600 Subject: [PATCH] Fixed enemies not freezing(elemental reaction) --- cheat-library/src/appdata/il2cpp-functions.h | 1 + cheat-library/src/user/cheat/world/FreezeEnemies.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cheat-library/src/appdata/il2cpp-functions.h b/cheat-library/src/appdata/il2cpp-functions.h index d3f5a9a..b40a760 100644 --- a/cheat-library/src/appdata/il2cpp-functions.h +++ b/cheat-library/src/appdata/il2cpp-functions.h @@ -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(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(0x058AE2D0, bool, Behaviour_get_isActiveAndEnabled, (Behaviour* __this, MethodInfo* method)); diff --git a/cheat-library/src/user/cheat/world/FreezeEnemies.cpp b/cheat-library/src/user/cheat/world/FreezeEnemies.cpp index a9d8bed..5b6ca72 100644 --- a/cheat-library/src/user/cheat/world/FreezeEnemies.cpp +++ b/cheat-library/src/user/cheat/world/FreezeEnemies.cpp @@ -9,6 +9,7 @@ namespace cheat::feature { + static bool change = false; FreezeEnemies::FreezeEnemies() : Feature(), NF(f_Enabled, "Freeze Enemies", "FreezeEnemies", false) @@ -61,11 +62,16 @@ namespace cheat::feature //LOG_DEBUG("%s", magic_enum::enum_name(constraints).data()); app::Rigidbody_set_constraints(rigidBody, app::RigidbodyConstraints__Enum::FreezeAll, nullptr); app::Animator_set_speed(animator, 0.f, nullptr); + change = false; } else { 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; + } } } }