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;
|
||||
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 (!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_merchantPanel) { g_merchantPanel->SetMinAspectRatio(g_UIAspect); g_merchantPanel->SetMaxAspectRatio(g_UIAspect); }
|
||||
if (g_gameMenu) { g_gameMenu->SetMinAspectRatio(g_UIAspect); g_gameMenu->SetMaxAspectRatio(g_UIAspect); }
|
||||
ApplyTransformOffset(g_PopupWidget, -HUDoffset);
|
||||
ApplyTransformOffset(g_PromptWidget, -HUDoffset * ((float)1080 / screenHeight));
|
||||
CenterWidget(g_ExplorationHUDWidget, HUDoffset, screenWidth, screenHeight, 1920, 1080);
|
||||
if (g_PopupWidget) ApplyTransformOffset(g_PopupWidget, -HUDoffset);
|
||||
if (g_PromptWidget) ApplyTransformOffset(g_PromptWidget, -HUDoffset * ((float)1080 / screenHeight));
|
||||
if (g_ExplorationHUDWidget) CenterWidget(g_ExplorationHUDWidget, HUDoffset, screenWidth, screenHeight, 1920, 1080);
|
||||
}
|
||||
|
||||
static void FOVFixEnabled() {
|
||||
@@ -416,14 +416,17 @@ static void EnableCheats(Cheat cheat) {
|
||||
UObject* object = (UObject*)ctx.rbx;
|
||||
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();
|
||||
if (now - lastActorScanTick >= DEFAULT_ACTORS_SCAN_BETWEEN_TICKS) {
|
||||
lastActorScanTick = now;
|
||||
auto* playerPawn = GetPawnFromWorld();
|
||||
if (!playerPawn) return;
|
||||
|
||||
if (playerPawn->IsA(ABP_jRPG_Character_Battle_Base_C::StaticClass())) {
|
||||
auto* playerBattle = static_cast<ABP_jRPG_Character_Battle_Base_C*>(playerPawn);
|
||||
if (pawn->IsA(ABP_jRPG_Character_Battle_Base_C::StaticClass())) {
|
||||
auto* playerBattle = static_cast<ABP_jRPG_Character_Battle_Base_C*>(pawn);
|
||||
if (playerBattle && playerBattle->AC_jRPG_CharacterStats) {
|
||||
double 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
|
||||
}
|
||||
}
|
||||
|
||||
if (playerPawn->IsA(ABP_jRPG_Character_World_C::StaticClass())) {
|
||||
auto* playerWorld = static_cast<ABP_jRPG_Character_World_C*>(playerPawn);
|
||||
else if (pawn->IsA(ABP_jRPG_Character_World_C::StaticClass())) {
|
||||
auto* playerWorld = static_cast<ABP_jRPG_Character_World_C*>(pawn);
|
||||
|
||||
if (g_fix_enabled && g_camera_fix_enabled && playerWorld->SmartSpringArm_MainCamera)
|
||||
g_PlayerSpringArm = playerWorld->SmartSpringArm_MainCamera; // Store custom player Springarm component
|
||||
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