Updated addon repository URL and improved debug output on download
[supertux.git] / src / scripting / serialize.cpp
index 5dbc6d1..ccbfd20 100644 (file)
@@ -22,7 +22,7 @@
 #include "lisp/list_iterator.hpp"
 #include "scripting/squirrel_error.hpp"
 
-namespace Scripting {
+namespace scripting {
 
 void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const Reader& lisp)
 {
@@ -64,7 +64,7 @@ void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const Reader& lisp
     }
 
     if(SQ_FAILED(sq_createslot(vm, table_idx)))
-      throw Scripting::SquirrelError(vm, "Couldn't create new index");
+      throw scripting::SquirrelError(vm, "Couldn't create new index");
   }
 }
 
@@ -99,8 +99,8 @@ void save_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, Writer& writer)
       }
       case OT_BOOL: {
         SQBool val;
-        sq_getbool(vm, -1, &val);
-        writer.write(key, val == SQTrue);
+        if(SQ_SUCCEEDED(sq_getbool(vm, -1, &val)))
+          writer.write(key, val == SQTrue);
         break;
       }
       case OT_STRING: {
@@ -128,6 +128,6 @@ void save_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, Writer& writer)
   sq_pop(vm, 1);
 }
 
-} // namespace Scripting
+} // namespace scripting
 
 /* EOF */