Removed a global variable
[supertux.git] / src / world.cpp
index b2bd524..53fcdb7 100644 (file)
@@ -1,5 +1,5 @@
-//  $Id: level_subset.cpp 3118 2006-03-25 17:29:08Z sommer $
-// 
+//  $Id$
+//
 //  SuperTux
 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
@@ -12,7 +12,7 @@
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -32,7 +32,7 @@
 #include "scripting/wrapper_util.hpp"
 #include "scripting/serialize.hpp"
 #include "log.hpp"
-#include "worldmap.hpp"
+#include "worldmap/worldmap.hpp"
 #include "mainloop.hpp"
 
 static bool has_suffix(const std::string& data, const std::string& suffix)
@@ -144,11 +144,9 @@ World::run()
     HSQUIRRELVM new_vm = ScriptManager::instance->create_thread();
     Scripting::compile_and_run(new_vm, in, filename);
   } catch(std::exception& e) {
+    // fallback: try to load worldmap worldmap.stwm
     using namespace WorldMapNS;
-    // fallback try to load worldmap
-    std::auto_ptr<WorldMap> worldmap (new WorldMap);
-    worldmap->loadmap(basedir + "worldmap.stwm");
-    main_loop->push_screen(worldmap.release());
+    main_loop->push_screen(new WorldMap(basedir + "worldmap.stwm"));
   }
 }