X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flevel.cpp;h=4b222bb8a25214f9d89cd9d5b69d32601333f8b6;hb=24dee16ba721c757b53c3cca08951c867b49c6a7;hp=c0f5b2582e370f1e92576099758255f06c8a00be;hpb=02afe1b64f521ccc6f81701c288dfd56d459215b;p=supertux.git diff --git a/src/level.cpp b/src/level.cpp index c0f5b2582..4b222bb8a 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -20,9 +20,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -58,7 +58,7 @@ Level::load(const std::string& filepath) { try { lisp::Parser parser; - std::auto_ptr root (parser.parse(filepath)); + const lisp::Lisp* root = parser.parse(filepath); const lisp::Lisp* level = root->get_lisp("supertux-level"); if(!level) @@ -71,6 +71,9 @@ Level::load(const std::string& filepath) return; } + contact = ""; + license = ""; + lisp::ListIterator iter(level); while(iter.next()) { const std::string& token = iter.item(); @@ -83,6 +86,10 @@ Level::load(const std::string& filepath) iter.value()->get(name); } else if(token == "author") { iter.value()->get(author); + } else if(token == "contact") { + iter.value()->get(contact); + } else if(token == "license") { + iter.value()->get(license); } else if(token == "on-menukey-script") { iter.value()->get(on_menukey_script); } else if(token == "sector") { @@ -94,6 +101,8 @@ Level::load(const std::string& filepath) } } + if (license == "") log_warning << "The level author did not specify a license for this level. You might not be allowed to share it." << std::endl; + } catch(std::exception& e) { std::stringstream msg; msg << "Problem when reading level '" << filepath << "': " << e.what();