1
0
forked from mirrors/0ad

Fixed broken tests by silently failing if Math.js is not found. This is not ideal but seems better than everything else.

This was SVN commit r11253.
This commit is contained in:
quantumstate
2012-03-05 21:20:39 +00:00
parent e9bbf25997
commit 0b0f2e9e30
+8 -4
View File
@@ -616,10 +616,14 @@ void ScriptInterface::ReplaceNondeterministicFunctions(boost::rand48& rng)
// Load a script which replaces some of the system dependent trig functions
VfsPath path("globalscripts/Math.js");
if (!this->LoadGlobalScriptFile(path))
{
LOGERROR(L"ReplaceNondeterministicFunctions: failed to load globalscripts/Math.js");
return;
// This function is called from tests scripts without the VFS set up so silently fail because every other option seems worse
if (g_VFS && VfsFileExists(path) ){
if (!this->LoadGlobalScriptFile(path))
{
LOGERROR(L"ReplaceNondeterministicFunctions: failed to load globalscripts/Math.js");
return;
}
}
}