From: Christoph Sommer Date: Mon, 8 Jan 2007 22:14:11 +0000 (+0000) Subject: Aborting a level no longer resets Tux to the last finished level: Engine now updates... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=65f71f62b50eaf665217c5892a43cdbcd17b277b;p=supertux.git Aborting a level no longer resets Tux to the last finished level: Engine now updates state and savegame when entering levels. SVN-Revision: 4537 --- diff --git a/src/worldmap/worldmap.cpp b/src/worldmap/worldmap.cpp index 94513d254..28e39a7bb 100644 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@ -431,8 +431,6 @@ WorldMap::finished_level(Level* gamelevel) calculate_total_stats(); save_state(); - if(World::current() != NULL) - World::current()->save_state(); if (old_level_state != level->solved && level->auto_path) { // Try to detect the next direction to which we should walk @@ -581,6 +579,10 @@ WorldMap::update(float delta) Vector shrinkpos = Vector(level->pos.x*32 + 16 - camera_offset.x, level->pos.y*32 + 16 - camera_offset.y); std::string levelfile = levels_path + level->get_name(); + + // update state and savegame + save_state(); + main_loop->push_screen(new GameSession(levelfile, &level->statistics), new ShrinkFade(shrinkpos, 0.5)); in_level = true; @@ -954,6 +956,9 @@ WorldMap::save_state() } sq_settop(vm, oldtop); + + if(World::current() != NULL) + World::current()->save_state(); } void