Tune caves
[oweals/minetest.git] / src / settings.h
index 9eb2254f06423c742da95fd76a54028ac4736f84..b95fbd1845ef4f5eae88ba24f4160b587882134f 100644 (file)
@@ -330,6 +330,7 @@ public:
        bool parseCommandLine(int argc, char *argv[],
                        core::map<std::string, ValueSpec> &allowed_options)
        {
+               int nonopt_index = 0;
                int i=1;
                for(;;)
                {
@@ -338,6 +339,15 @@ public:
                        std::string argname = argv[i];
                        if(argname.substr(0, 2) != "--")
                        {
+                               // If option doesn't start with -, read it in as nonoptX
+                               if(argname[0] != '-'){
+                                       std::string name = "nonopt";
+                                       name += itos(nonopt_index);
+                                       set(name, argname);
+                                       nonopt_index++;
+                                       i++;
+                                       continue;
+                               }
                                errorstream<<"Invalid command-line parameter \""
                                                <<argname<<"\": --<option> expected."<<std::endl;
                                return false;
@@ -425,8 +435,6 @@ public:
                        n = m_defaults.find(name);
                        if(n == NULL)
                        {
-                               infostream<<"Settings: Setting not found: \""
-                                               <<name<<"\""<<std::endl;
                                throw SettingNotFoundException("Setting not found");
                        }
                }