a few more opengles changes
[supertux.git] / src / scripting / level.cpp
index 25e0fa9..8967741 100644 (file)
@@ -36,12 +36,18 @@ namespace Scripting
   void
   Level::finish(bool win)
   {
+    if(GameSession::current() == NULL)
+      return;
+
     GameSession::current()->finish(win);
   }
 
   void
   Level::spawn(const std::string& sector, const std::string& spawnpoint)
   {
+    if(GameSession::current() == NULL)
+      return;
+
     GameSession::current()->respawn(sector, spawnpoint);
   }
 
@@ -51,4 +57,20 @@ namespace Scripting
     FlipLevelTransformer flip_transformer;
     flip_transformer.transform(GameSession::current()->get_current_level());
   }
+
+  void
+  Level::toggle_pause()
+  {
+    if(GameSession::current() == NULL)
+      return;
+    GameSession::current()->toggle_pause();
+  }
+
+  void
+  Level::edit(bool edit_mode)
+  {
+    if(GameSession::current() == NULL) return;
+    GameSession::current()->set_editmode(edit_mode);
+  }
+
 }