From 58274e1d01b19713ba00cde992529fed5f73dfee Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Sun, 28 Jan 2007 10:38:02 +0000 Subject: [PATCH] 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 --- src/scripting/functions.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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(); } -- 2.11.0