From: Ricardo Cruz Date: Tue, 27 Jul 2004 16:44:36 +0000 (+0000) Subject: Added auto-walk field for world maps. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ca9da109c06b5d4a4f8c9c2087b7f317e746be42;p=supertux.git Added auto-walk field for world maps. (auto-walk #f) makes the player not walk or walk (default to walk) after finishing level. Not sure if it is usefull, but could be used in levels in a hidden place to not reveal the next one. SVN-Revision: 1635 --- diff --git a/src/worldmap.cpp b/src/worldmap.cpp index 23b42b2df..3d1457eec 100644 --- a/src/worldmap.cpp +++ b/src/worldmap.cpp @@ -436,6 +436,7 @@ WorldMap::load_map() reader.read_string("level", level.name, true); reader.read_int("x", level.x); reader.read_int("y", level.y); + reader.read_bool("auto-path", &level.auto_path); level.swap_x = level.swap_y = -1; reader.read_int("swap-x", level.swap_x); reader.read_int("swap-y", level.swap_y); @@ -695,7 +696,7 @@ WorldMap::update(float delta) else player_status.bonus = PlayerStatus::NO_BONUS; - if (old_level_state != level->solved) + if (old_level_state != level->solved && level->auto_path) { // Try to detect the next direction to which we should walk // FIXME: Mostly a hack Direction dir = D_NONE; diff --git a/src/worldmap.h b/src/worldmap.h index 4ad8243cc..72c793792 100644 --- a/src/worldmap.h +++ b/src/worldmap.h @@ -167,6 +167,9 @@ public: /** Quit the worldmap */ bool quit_worldmap; + /** If false, disables the auto walking after finishing a level */ + bool auto_path; + // Directions which are walkable from this level bool north; bool east;