Skip to content

Commit

Permalink
fix: Handle if world travel fails
Browse files Browse the repository at this point in the history
  • Loading branch information
nt153133 committed Aug 24, 2024
1 parent de6daf8 commit 9656686
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Helpers/WorldTravel/WorldTravel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,25 @@ public static async Task<bool> GoToWorld(ushort worldId, TravelCity travelCity =

Log.Information($"Going to: {((World)Choices[i].WorldID).WorldName()}");
WorldTravelSelect.Instance.SelectWorld(i);
await Coroutine.Wait(5000, () => SelectYesno.IsOpen);
if (!await Coroutine.Wait(5000, () => SelectYesno.IsOpen))
{
Log.Error("Select Yesno did not open");
WorldTravelSelect.Instance.Close();
return false;
}

if (SelectYesno.IsOpen)
{
SelectYesno.Yes();
await Coroutine.Wait(1_200_000, () => WorldTravelFinderReady.Instance.IsOpen);
await Coroutine.Wait(5000, () => !SelectYesno.IsOpen);
if (!await Coroutine.Wait(1_200_000, () => WorldTravelFinderReady.Instance.IsOpen))
{
Log.Error("WorldTravelFinderReady did not open");
WorldTravelSelect.Instance.Close();
await Coroutine.Wait(5000, () => !WorldTravelSelect.Instance.IsOpen);
return false;
}

if (WorldTravelFinderReady.Instance.IsOpen)
{
await Coroutine.Wait(-1, () => !WorldTravelFinderReady.Instance.IsOpen);
Expand Down

0 comments on commit 9656686

Please sign in to comment.