fix session being stopped before puzzle measured

This commit is contained in:
2022-12-09 11:00:00 +01:00
parent 429f9536a9
commit f5142435fc
2 changed files with 2 additions and 8 deletions

View File

@@ -54,14 +54,6 @@ namespace EscapeRoomEngine.Engine.Runtime.Modules
protected virtual void Start() protected virtual void Start()
{ {
OnPuzzleEvent(PuzzleEventType.Restarted); OnPuzzleEvent(PuzzleEventType.Restarted);
PuzzleEvent += (_, type) =>
{
if (type == PuzzleEventType.Solved)
{
Measure.Solve((PuzzleModuleDescription)Module.description);
}
};
} }
private void OnPuzzleEvent(PuzzleEventType type) private void OnPuzzleEvent(PuzzleEventType type)

View File

@@ -59,6 +59,8 @@ namespace EscapeRoomEngine.Engine.Runtime
{ {
if (type == PuzzleEventType.Solved) if (type == PuzzleEventType.Solved)
{ {
Measure.Solve((PuzzleModuleDescription)puzzle.description);
if (LastRoom) if (LastRoom)
{ {
GameControl.Instance.StopGame(); GameControl.Instance.StopGame();