From cd0afdabc1077c1cc21700ab3d6223bc90f91b8f Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Wed, 26 Jul 2006 17:43:28 +0000 Subject: [PATCH] Fixed a bug: Empty fade_tilemap attribute faded out all tilemaps with empty name attribute SVN-Revision: 4095 --- src/trigger/secretarea_trigger.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/trigger/secretarea_trigger.cpp b/src/trigger/secretarea_trigger.cpp index 5896a5c0d..1c4649578 100644 --- a/src/trigger/secretarea_trigger.cpp +++ b/src/trigger/secretarea_trigger.cpp @@ -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(*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(*i); + if (!tm) continue; + if (tm->get_name() != fade_tilemap) continue; + tm->fade(0.0, 1.0); + } } } -- 2.11.0