Added auto-walk field for world maps.
authorRicardo Cruz <rick2@aeiou.pt>
Tue, 27 Jul 2004 16:44:36 +0000 (16:44 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Tue, 27 Jul 2004 16:44:36 +0000 (16:44 +0000)
(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

src/worldmap.cpp
src/worldmap.h

index 23b42b2..3d1457e 100644 (file)
@@ -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;
index 4ad8243..72c7937 100644 (file)
@@ -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;