]> Dogcows Code - chaz/yoink/blobdiff - src/Scene.cc
bugfix: resource file searching was broken
[chaz/yoink] / src / Scene.cc
index bfc788af1a75f46ed0f5adfa19ac963be5420c74..afbfa440f9f915f949feda5e459b7c4fa1d80c2e 100644 (file)
@@ -195,15 +195,15 @@ struct Scene::Impl : public Mf::Manager<Impl>
 
        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);
        }
 
 
@@ -609,8 +609,8 @@ bool Scene::checkForCollision(Character& character)
 }
 
 
-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");
 }
 
This page took 0.019491 seconds and 4 git commands to generate.