X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fscripting%2Ffunctions.cpp;h=456b351fca56a68fdce61e1464752edd76eeca99;hb=62816f56a485fa91b3d157a75c1d0cf568e394cf;hp=236a12ad2ed21f1421a669cbae0e75bdcebbc7eb;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/scripting/functions.cpp b/src/scripting/functions.cpp index 236a12ad2..456b351fc 100644 --- a/src/scripting/functions.cpp +++ b/src/scripting/functions.cpp @@ -166,11 +166,20 @@ void save_state() if(World::current() == NULL) throw std::runtime_error("Can't save state without active World"); - if(WorldMap::current() != NULL) - WorldMap::current()->save_state(); + WorldMap::current()->save_state(); World::current()->save_state(); } +void update_worldmap() +{ + using namespace WorldMapNS; + + if(World::current() == NULL) + throw std::runtime_error("Can't save state without active World"); + + WorldMap::current()->load_state(); +} + // not added to header, function to only be used by others // in this file bool validate_sector_player()