Added error handling in wren. Game while abort lauching and print error in logger

This commit is contained in:
Antoine Pilote
2021-07-03 18:31:32 -04:00
parent f5bcb12f61
commit b384154eb4
14 changed files with 50 additions and 22 deletions

View File

@@ -73,9 +73,10 @@ void Engine::EnterPlayMode()
{
// Dont trigger init if already in player mode.
if (!IsPlayMode)
GetCurrentScene()->OnInit();
IsPlayMode = true;
if(GetCurrentScene()->OnInit())
IsPlayMode = true;
else
GetCurrentScene()->OnExit();
}
void Engine::ExitPlayMode()
@@ -86,6 +87,7 @@ void Engine::ExitPlayMode()
Input::ShowMouse();
}
Input::ShowMouse();
IsPlayMode = false;
}