Author: silene
Date: Mon Apr 13 13:48:58 2009
New Revision: 34850
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34850&view=rev
Log:
Moved 'filter'-hack out of the action handler.
Modified:
trunk/src/game_events.cpp
Modified: trunk/src/game_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=34850&r1=34849&r2=34850&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Mon Apr 13 13:48:58 2009
@@ -274,8 +274,7 @@
(*itor->second)(eh, event_info, cfg);
return true;
}
- // Return true if we have /^filter.*/ tag
- return cmd.compare(0, strlen("filter"),"filter") == 0;
+ return false;
}
static bool unit_matches_filter(const unit& u, const vconfig
filter,const map_location& loc);
@@ -3447,10 +3446,15 @@
DBG_NG << cfg_["name"] << " will now invoke the
following command(s):\n" << cfg.get_config();
}
- for(vconfig::all_children_iterator i = cfg.ordered_begin();
- i != cfg.ordered_end(); ++i) {
-
- handle_event_command(event_info, i.get_key(),
i.get_child());
+ for (vconfig::all_children_iterator i = cfg.ordered_begin(),
+ i_end = cfg.ordered_end(); i != i_end; ++i)
+ {
+ const std::string &cmd = i.get_key();
+ // Skip if this is a /^filter.*/ tag
+ if (cmd.compare(0, 6, "filter") == 0)
+ continue;
+
+ handle_event_command(event_info, cmd, i.get_child());
}
// We do this once the event has completed any music alterations
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits