Skip to content

Commit

Permalink
Fix accidental split when die to Ark
Browse files Browse the repository at this point in the history
  • Loading branch information
fhelwanger committed Sep 8, 2023
1 parent 59bd298 commit 3b0163d
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion FinalFantasy9.asl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ startup
settings.SetToolTip("debug", "Add a TextComponent with \"SceneId:\" or \"SceneType:\" on the left text to show the variables' values. Used only to debug problems in the auto splitter.");

vars.newGameButtonFocused = false;
vars.isFightingArk = false;
}

update
Expand All @@ -128,6 +129,21 @@ update
vars.newGameButtonFocused = false;
}

// Both Ark fight and title screen have sceneId equals 0.
// Because of that, we need to track whether we were on the title screen or a battle when sceneId is 0,
// so we don't split by accident after continuing a game over on Ark.
if (current.sceneId == 0)
{
if (current.sceneType == 4)
{
vars.isFightingArk = false;
}
else if (current.sceneType == 3)
{
vars.isFightingArk = true;
}
}

if (settings["debug"])
{
if (old.sceneId != current.sceneId)
Expand Down Expand Up @@ -198,7 +214,14 @@ split
}
else if (old.sceneId == vars.splitsOldSceneId[split] && current.sceneId == vars.splitsCurrentSceneId[split])
{
shouldSplit = true;
if (split == "disc3.ark")
{
shouldSplit = vars.isFightingArk;
}
else
{
shouldSplit = true;
}
}

if (shouldSplit)
Expand Down

0 comments on commit 3b0163d

Please sign in to comment.