X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscripting%2Flevel.cpp;h=f780ee29b69b372bf817e52bb8595a306ccbb401;hb=2892ebda09d24c977547159e34abf0244884b89e;hp=25e0fa94b8d8aede80f275100099ac858a9f87de;hpb=07ddaed2a657e4d2a3d038fed223fc5827159caf;p=supertux.git diff --git a/src/scripting/level.cpp b/src/scripting/level.cpp index 25e0fa94b..f780ee29b 100644 --- a/src/scripting/level.cpp +++ b/src/scripting/level.cpp @@ -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,12 @@ 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(); + } }