X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FScene.cc;h=afbfa440f9f915f949feda5e459b7c4fa1d80c2e;hp=bfc788af1a75f46ed0f5adfa19ac963be5420c74;hb=90b2c7fb10b244b781b84965a0d36f1f323ee94d;hpb=8148b51f1bec8f662672d3ca36eea1784991e5cc diff --git a/src/Scene.cc b/src/Scene.cc index bfc788a..afbfa44 100644 --- a/src/Scene.cc +++ b/src/Scene.cc @@ -195,15 +195,15 @@ struct Scene::Impl : public Mf::Manager 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"); }