From bc59508cd9aa1bdea651f7e5060af13d6a30d6c0 Mon Sep 17 00:00:00 2001 From: CallowBlack Date: Tue, 31 May 2022 12:35:58 +0300 Subject: [PATCH] update 2.7 (#46): fix intreactive map & radar (rotation mode) --- cheat-library/src/appdata/il2cpp-functions.h | 1 + cheat-library/src/appdata/il2cpp-types.h | 1 + cheat-library/src/user/cheat/imap/InteractiveMap.cpp | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cheat-library/src/appdata/il2cpp-functions.h b/cheat-library/src/appdata/il2cpp-functions.h index a838731..65f8708 100644 --- a/cheat-library/src/appdata/il2cpp-functions.h +++ b/cheat-library/src/appdata/il2cpp-functions.h @@ -272,6 +272,7 @@ DO_APP_FUNC(0x06533C30, int32_t, Screen_get_height, (MethodInfo* method)); DO_APP_FUNC(0x0664CF50, bool, Behaviour_get_isActiveAndEnabled, (Behaviour* __this, MethodInfo* method)); +DO_APP_FUNC(0x066306D0, Vector3, Quaternion_ToEulerAngles, (Quaternion rotation, MethodInfo* method)); DO_APP_FUNC(0x066309A0, Vector3, Quaternion_get_eulerAngles, (Quaternion__Boxed* __this, MethodInfo* method)); DO_APP_FUNC(0x06555C70, Quaternion, Transform_get_rotation, (Transform* __this, MethodInfo* method)); DO_APP_FUNC(0x06552F50, Rect, RectTransform_get_rect, (RectTransform* __this, MethodInfo* method)); diff --git a/cheat-library/src/appdata/il2cpp-types.h b/cheat-library/src/appdata/il2cpp-types.h index e6acd83..ea3a178 100644 --- a/cheat-library/src/appdata/il2cpp-types.h +++ b/cheat-library/src/appdata/il2cpp-types.h @@ -8932,6 +8932,7 @@ namespace app { bool _setViewAsFirst; struct List_1_MoleMole_BaseContextComponent_* _baseComponentList; struct List_1_MoleMole_BaseContextComponent_* _tickComponentList; + struct List_1_MoleMole_BaseContextComponent_* _lateTickComponentList; struct Dictionary_2_System_Int32_List_1_MoleMole_BaseContextComponent_* _baseComponentNotifyRegister; struct Dictionary_2_System_Int32_List_1_MoleMole_BaseContextComponent_* _baseComponentPacketRegister; struct Dictionary_2_System_Int32_List_1_MoleMole_BaseContextComponent_* _baseComponentActionEventRegister; diff --git a/cheat-library/src/user/cheat/imap/InteractiveMap.cpp b/cheat-library/src/user/cheat/imap/InteractiveMap.cpp index 5d90710..6356df2 100644 --- a/cheat-library/src/user/cheat/imap/InteractiveMap.cpp +++ b/cheat-library/src/user/cheat/imap/InteractiveMap.cpp @@ -1591,14 +1591,14 @@ namespace cheat::feature auto rotation = app::Transform_get_rotation(reinterpret_cast(back), nullptr); app::Quaternion__Boxed boxed = { nullptr, nullptr, rotation }; - return app::Quaternion_get_eulerAngles(&boxed, nullptr).z; + return app::Quaternion_ToEulerAngles(rotation, nullptr).z; } void InteractiveMap::DrawMinimapPoints() { // Found by hands. Only in Teyvat (3rd scene), need also test another scenes. static const float minimapAreaLevelRadius = 175.0f; - constexpr float PI = 3.14159265f; + constexpr float TWO_PI = 2 * 3.14159265f; auto sceneID = game::GetCurrentPlayerSceneID(); if (m_ScenesData.count(sceneID) == 0) @@ -1608,7 +1608,7 @@ namespace cheat::feature ImVec2 rotationMult = ImVec2(1.0f, 0.0f); if (rotation != 0) { - auto rad = ( (360.0f - rotation) * PI ) / 180.0f; + auto rad = TWO_PI - rotation;// ((360.0f - rotation) * PI) / 180.0f; rotationMult = { sin(rad), cos(rad) }; }