Mf::Script::Result load(Mf::Settings& settings, Mf::Script& script)
{
- std::string filePath = Scene::getPath(getName());
- if (filePath == "")
+ std::string path(getName());
+ if (!Scene::getPath(path))
{
script.push("the scene file could not be found");
return Mf::Script::FILE_ERROR;
}
importSceneBindings(settings, script);
- return script.doFile(filePath);
+ return script.doFile(path);
}
}
-std::string Scene::getPath(const std::string& name)
+bool Scene::getPath(std::string& name)
{
- return Mf::Resource::getPath("scenes/" + name + ".lua");
+ return Mf::Resource::getPath(name, "scenes/", "lua");
}