Author: sapient
Date: Fri Apr 13 04:24:29 2007
New Revision: 16800
URL: http://svn.gna.org/viewcvs/wesnoth?rev=16800&view=rev
Log:
fix bug #8773 and bug #8903 - "Recall events in scenarios are broken"
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=16800&r1=16799&r2=16800&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Fri Apr 13 04:24:29 2007
@@ -1409,6 +1409,12 @@
else if(cmd == "recall") {
LOG_NG << "recalling unit...\n";
bool unit_recalled = false;
+ config unit_filter(cfg.get_config());
+ //prevent the recall unit filter from using the location as a
criterion
+ // FIXME: we should design the WML to avoid these types of
collisions;
+ // filters should be named consistently and always have a
distinct scope
+ unit_filter["x"] = "";
+ unit_filter["y"] = "";
for(int index = 0; !unit_recalled && index <
int(teams->size()); ++index) {
LOG_NG << "for side " << index << "...\n";
const std::string player_id = (*teams)[index].save_id();
@@ -1426,7 +1432,7 @@
wassert(game_data_ptr != NULL);
u->set_game_context(game_data_ptr,units,game_map,status_ptr,teams);
scoped_recall_unit("this_unit", player_id, u -
avail.begin());
- if(game_events::unit_matches_filter(*u,
cfg,gamemap::location())) {
+ if(game_events::unit_matches_filter(*u,
&unit_filter, gamemap::location())) {
gamemap::location loc = cfg_to_loc(cfg);
unit to_recruit(*u);
avail.erase(u); //erase before
recruiting, since recruiting can fire more events
_______________________________________________
Wesnoth-commits mailing list
[EMAIL PROTECTED]
https://mail.gna.org/listinfo/wesnoth-commits