Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv318/src
Modified Files:
worldmap.cpp worldmap.h
Log Message:
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.
Index: worldmap.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- worldmap.cpp 27 Jul 2004 13:25:05 -0000 1.102
+++ worldmap.cpp 27 Jul 2004 16:44:34 -0000 1.103
@@ -436,6 +436,7 @@
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 @@
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: worldmap.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- worldmap.h 20 Jul 2004 18:04:49 -0000 1.39
+++ worldmap.h 27 Jul 2004 16:44:36 -0000 1.40
@@ -167,6 +167,9 @@
/** 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;
|