forked from mirrors/0ad
Throw error when simulation script can't be loaded
When a script in "simulation/helpers/" contained an error. Files in "simulation/components" aren't loaded. The return value of `LoadDefaultScripts` indicated an error but was ignored. The simulation still tried to start. Now instead of returning a ignoreable error code the error is thrown. In the common path the error is implicitly rethrown to the JS-function which tried to start the game. fixes: #8133
This commit is contained in:
@@ -320,7 +320,14 @@ ActorViewer::ActorViewer()
|
||||
}
|
||||
|
||||
// Prepare the simulation
|
||||
m.Simulation2.LoadDefaultScripts();
|
||||
try
|
||||
{
|
||||
m.Simulation2.LoadDefaultScripts();
|
||||
}
|
||||
catch (const CSimulation2::LoadScriptError& e)
|
||||
{
|
||||
LOGERROR("%s", e.what());
|
||||
}
|
||||
m.Simulation2.ResetState();
|
||||
|
||||
// Set player data
|
||||
|
||||
Reference in New Issue
Block a user