Fixed an issue where the game would crash in certain occasions. fix and cheats improvement
This commit is contained in:
@@ -261,7 +261,7 @@ static void ProcessEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!object || !func) return;
|
if (!object || !func) return;
|
||||||
UC::int32 comparisonIndex = func->Name.ComparisonIndex;
|
UC::int32 comparisonIndex = func->Name.ComparisonIndex; // Make function comparision faster than allocating std::srting
|
||||||
if (NAME_FindPlayerStart == -1 && func->Name.ToString() == "FindPlayerStart") NAME_FindPlayerStart = comparisonIndex;
|
if (NAME_FindPlayerStart == -1 && func->Name.ToString() == "FindPlayerStart") NAME_FindPlayerStart = comparisonIndex;
|
||||||
|
|
||||||
if (!bootStrap && NAME_FindPlayerStart == comparisonIndex && object->IsA(ABP_jRPG_GM_Bootstrap_C::StaticClass()))
|
if (!bootStrap && NAME_FindPlayerStart == comparisonIndex && object->IsA(ABP_jRPG_GM_Bootstrap_C::StaticClass()))
|
||||||
@@ -322,9 +322,9 @@ static void HUDUpdate(bool writeLog) {
|
|||||||
if (g_MainMenu) { g_MainMenu->SetMinAspectRatio(g_UIAspect); g_MainMenu->SetMaxAspectRatio(g_UIAspect); }
|
if (g_MainMenu) { g_MainMenu->SetMinAspectRatio(g_UIAspect); g_MainMenu->SetMaxAspectRatio(g_UIAspect); }
|
||||||
if (g_merchantPanel) { g_merchantPanel->SetMinAspectRatio(g_UIAspect); g_merchantPanel->SetMaxAspectRatio(g_UIAspect); }
|
if (g_merchantPanel) { g_merchantPanel->SetMinAspectRatio(g_UIAspect); g_merchantPanel->SetMaxAspectRatio(g_UIAspect); }
|
||||||
if (g_gameMenu) { g_gameMenu->SetMinAspectRatio(g_UIAspect); g_gameMenu->SetMaxAspectRatio(g_UIAspect); }
|
if (g_gameMenu) { g_gameMenu->SetMinAspectRatio(g_UIAspect); g_gameMenu->SetMaxAspectRatio(g_UIAspect); }
|
||||||
ApplyTransformOffset(g_PopupWidget, -HUDoffset);
|
if (g_PopupWidget) ApplyTransformOffset(g_PopupWidget, -HUDoffset);
|
||||||
ApplyTransformOffset(g_PromptWidget, -HUDoffset * ((float)1080 / screenHeight));
|
if (g_PromptWidget) ApplyTransformOffset(g_PromptWidget, -HUDoffset * ((float)1080 / screenHeight));
|
||||||
CenterWidget(g_ExplorationHUDWidget, HUDoffset, screenWidth, screenHeight, 1920, 1080);
|
if (g_ExplorationHUDWidget) CenterWidget(g_ExplorationHUDWidget, HUDoffset, screenWidth, screenHeight, 1920, 1080);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FOVFixEnabled() {
|
static void FOVFixEnabled() {
|
||||||
@@ -416,14 +416,17 @@ static void EnableCheats(Cheat cheat) {
|
|||||||
UObject* object = (UObject*)ctx.rbx;
|
UObject* object = (UObject*)ctx.rbx;
|
||||||
if (!object || !object->Class) return;
|
if (!object || !object->Class) return;
|
||||||
|
|
||||||
|
auto* actor = static_cast<AActor*>(object);
|
||||||
|
if (actor && actor->IsA(ABP_jRPG_Enemy_World_Base_Seamless_C::StaticClass()))
|
||||||
|
actor->CustomTimeDilation = g_TimeDilation_fix_enabled ? g_AITimeDilationValue : 1.f;
|
||||||
|
|
||||||
|
auto* pawn = GetPawnFromObject(object);
|
||||||
|
if (!pawn) return;
|
||||||
ULONGLONG now = GetTickCount64();
|
ULONGLONG now = GetTickCount64();
|
||||||
if (now - lastActorScanTick >= DEFAULT_ACTORS_SCAN_BETWEEN_TICKS) {
|
if (now - lastActorScanTick >= DEFAULT_ACTORS_SCAN_BETWEEN_TICKS) {
|
||||||
lastActorScanTick = now;
|
lastActorScanTick = now;
|
||||||
auto* playerPawn = GetPawnFromWorld();
|
if (pawn->IsA(ABP_jRPG_Character_Battle_Base_C::StaticClass())) {
|
||||||
if (!playerPawn) return;
|
auto* playerBattle = static_cast<ABP_jRPG_Character_Battle_Base_C*>(pawn);
|
||||||
|
|
||||||
if (playerPawn->IsA(ABP_jRPG_Character_Battle_Base_C::StaticClass())) {
|
|
||||||
auto* playerBattle = static_cast<ABP_jRPG_Character_Battle_Base_C*>(playerPawn);
|
|
||||||
if (playerBattle && playerBattle->AC_jRPG_CharacterStats) {
|
if (playerBattle && playerBattle->AC_jRPG_CharacterStats) {
|
||||||
double maxHP;
|
double maxHP;
|
||||||
playerBattle->AC_jRPG_CharacterStats->GetMaxHP(&maxHP);
|
playerBattle->AC_jRPG_CharacterStats->GetMaxHP(&maxHP);
|
||||||
@@ -431,18 +434,13 @@ static void EnableCheats(Cheat cheat) {
|
|||||||
playerBattle->DEBUG_IgnoreDamages = g_GodMode_fix_enabled; // God mode
|
playerBattle->DEBUG_IgnoreDamages = g_GodMode_fix_enabled; // God mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (pawn->IsA(ABP_jRPG_Character_World_C::StaticClass())) {
|
||||||
if (playerPawn->IsA(ABP_jRPG_Character_World_C::StaticClass())) {
|
auto* playerWorld = static_cast<ABP_jRPG_Character_World_C*>(pawn);
|
||||||
auto* playerWorld = static_cast<ABP_jRPG_Character_World_C*>(playerPawn);
|
|
||||||
|
|
||||||
if (g_fix_enabled && g_camera_fix_enabled && playerWorld->SmartSpringArm_MainCamera)
|
if (g_fix_enabled && g_camera_fix_enabled && playerWorld->SmartSpringArm_MainCamera)
|
||||||
g_PlayerSpringArm = playerWorld->SmartSpringArm_MainCamera; // Store custom player Springarm component
|
g_PlayerSpringArm = playerWorld->SmartSpringArm_MainCamera; // Store custom player Springarm component
|
||||||
playerWorld->DEBUG_IsInvisible = g_Stealth_fix_enabled; // Stealth mode
|
playerWorld->DEBUG_IsInvisible = g_Stealth_fix_enabled; // Stealth mode
|
||||||
}
|
}
|
||||||
}
|
|
||||||
AActor* actor = static_cast<AActor*>(object);
|
|
||||||
if (actor && actor->IsA(ABP_jRPG_Enemy_World_Base_Seamless_C::StaticClass())) {
|
|
||||||
actor->CustomTimeDilation = g_TimeDilation_fix_enabled ? g_AITimeDilationValue : 1.f;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user