fixed the worldmap::save_state bug in another way (throw an exception so people know...
[supertux.git] / src / scripting / functions.cpp
index 456b351..c2f8c98 100644 (file)
@@ -163,7 +163,7 @@ void save_state()
 {
   using namespace WorldMapNS;
 
-  if(World::current() == NULL)
+  if(World::current() == NULL || WorldMap::current() == NULL)
     throw std::runtime_error("Can't save state without active World");
 
   WorldMap::current()->save_state();
@@ -174,8 +174,8 @@ void update_worldmap()
 {
   using namespace WorldMapNS;
 
-  if(World::current() == NULL)
-    throw std::runtime_error("Can't save state without active World");
+  if(WorldMap::current() == NULL)
+    throw std::runtime_error("Can't update Worldmap: none active");
 
   WorldMap::current()->load_state();
 }