From: Matthias Braun Date: Sun, 28 Jan 2007 10:38:02 +0000 (+0000) Subject: fixed the worldmap::save_state bug in another way (throw an exception so people know... X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=58274e1d01b19713ba00cde992529fed5f73dfee;p=supertux.git fixed the worldmap::save_state bug in another way (throw an exception so people know what is going on) and fixed a similar bug in update_worldmap SVN-Revision: 4694 --- diff --git a/src/scripting/functions.cpp b/src/scripting/functions.cpp index b97881344..c2f8c98fb 100644 --- a/src/scripting/functions.cpp +++ b/src/scripting/functions.cpp @@ -163,11 +163,10 @@ 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"); - if(WorldMap::current() != NULL) - WorldMap::current()->save_state(); + WorldMap::current()->save_state(); World::current()->save_state(); } @@ -175,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(); }