Update failing test coverage and fix `onFail` being called too often

This commit is contained in:
Dean Herbert 2023-11-23 10:28:15 +09:00
parent 4ad3cb3b49
commit ef5dd24589
No known key found for this signature in database
3 changed files with 4 additions and 5 deletions

View File

@ -179,7 +179,6 @@ public void TestSubmissionOnFail()
addFakeHit();
AddUntilStep("wait for fail", () => Player.GameplayState.HasFailed);
AddStep("exit", () => Player.Exit());
AddUntilStep("wait for submission", () => Player.SubmittedScore != null);
AddAssert("ensure failing submission", () => Player.SubmittedScore.ScoreInfo.Passed == false);

View File

@ -933,6 +933,7 @@ private bool onFail()
if (GameplayState.Mods.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
Restart(true);
OnFail();
return true;
}

View File

@ -54,8 +54,6 @@ private void load()
}
AddInternal(new PlayerTouchInputDetector());
HealthProcessor.Failed += onFail;
}
protected override void LoadAsyncComplete()
@ -167,10 +165,11 @@ protected override void StartGameplay()
spectatorClient.BeginPlaying(token, GameplayState, Score);
}
private bool onFail()
protected override void OnFail()
{
base.OnFail();
submitFromFailOrQuit();
return true;
}
public override bool OnExiting(ScreenExitEvent e)