Prevent "Return to Level Editor" from working, if no levelsubset is loaded. This...
[supertux.git] / src / lispreader.cpp
index 0ece43d..8f1fe2f 100644 (file)
@@ -21,6 +21,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <iostream>
 #include <string>
 #include <assert.h>
 #include <ctype.h>
 static char token_string[MAX_TOKEN_LENGTH + 1] = "";
 static int token_length = 0;
 
-static lisp_object_t end_marker = { LISP_TYPE_EOF , {0,0}  };
-static lisp_object_t error_object = { LISP_TYPE_PARSE_ERROR , {0,0}  };
-static lisp_object_t close_paren_marker = { LISP_TYPE_PARSE_ERROR , {0,0}  };
-static lisp_object_t dot_marker = { LISP_TYPE_PARSE_ERROR , {0,0} };
+static lisp_object_t end_marker = { LISP_TYPE_EOF, {{0, 0}} };
+static lisp_object_t error_object = { LISP_TYPE_PARSE_ERROR , {{0,0}}  };
+static lisp_object_t close_paren_marker = { LISP_TYPE_PARSE_ERROR , {{0,0}}  };
+static lisp_object_t dot_marker = { LISP_TYPE_PARSE_ERROR , {{0,0}} };
 
 static void
 _token_clear (void)
@@ -1042,7 +1043,10 @@ LispReader::read_int (const char* name, int* i)
   if (obj)
     {
       if (!lisp_integer_p(lisp_car(obj)))
-        st_abort("LispReader expected type integer at token: ", name);
+      {
+        //st_abort("LispReader expected type integer at token: ", name); /* Instead of giving up, we return with false now. */
+       return false;
+       }
       *i = lisp_integer(lisp_car(obj));
       return true;
     }
@@ -1316,18 +1320,6 @@ lisp_object_t* lisp_read_from_file(const std::string& filename)
   if (has_suffix(filename.c_str(), ".gz"))
     {
       return lisp_read_from_gzfile(filename.c_str());
-#if 0
-      lisp_object_t* obj = 0;
-      gzFile in = gzopen(filename, "r");
-
-      if (in)
-        {
-          lisp_stream_init_gzfile(&stream, in);
-          obj = lisp_read(&stream);
-          gzclose(in);
-        }
-        return obj;
-#endif
     }
   else
     {