Fixed a bug: Empty fade_tilemap attribute faded out all tilemaps with empty name...
authorChristoph Sommer <mail@christoph-sommer.de>
Wed, 26 Jul 2006 17:43:28 +0000 (17:43 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Wed, 26 Jul 2006 17:43:28 +0000 (17:43 +0000)
SVN-Revision: 4095

src/trigger/secretarea_trigger.cpp

index 5896a5c..1c46495 100644 (file)
@@ -95,14 +95,15 @@ SecretAreaTrigger::event(Player& , EventType type)
       message_displayed = true;
       Sector::current()->get_level()->stats.secrets++;
 
-      // FIXME: testing only
-      // fade away tilemaps named "secret"
-      Sector& sector = *Sector::current();
-      for(Sector::GameObjects::iterator i = sector.gameobjects.begin(); i != sector.gameobjects.end(); ++i) {
-       TileMap* tm = dynamic_cast<TileMap*>(*i);
-       if (!tm) continue;
-       if (tm->get_name() != fade_tilemap) continue;
-       tm->fade(0.0, 1.0);
+      if (fade_tilemap != "") {
+       // fade away tilemaps
+       Sector& sector = *Sector::current();
+       for(Sector::GameObjects::iterator i = sector.gameobjects.begin(); i != sector.gameobjects.end(); ++i) {
+         TileMap* tm = dynamic_cast<TileMap*>(*i);
+         if (!tm) continue;
+         if (tm->get_name() != fade_tilemap) continue;
+         tm->fade(0.0, 1.0);
+       }
       }
 
     }