Author: crab
Date: Thu Apr 2 00:27:56 2009
New Revision: 34378
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34378&view=rev
Log:
Fixed bug #13295. enemy_units formula now ignores incapacitated units,
such as statues in the 'Caves of The Basilisk'
Modified:
trunk/changelog
trunk/src/formula_ai.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=34378&r1=34377&r2=34378&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Thu Apr 2 00:27:56 2009
@@ -19,6 +19,8 @@
via floating popups on the specified hex
* Added run_file FormulaAI function to allow running .fai scripts directly
from in-game console
+ * Fixed bug #13295: made enemy_units formula return only those units which
+ are not incapacitated (for example, it now ignores stoned units )
* Graphics:
* New type of animation : "recruiting" used by leaders when recruiting
units
Modified: trunk/src/formula_ai.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/formula_ai.cpp?rev=34378&r1=34377&r2=34378&view=diff
==============================================================================
--- trunk/src/formula_ai.cpp (original)
+++ trunk/src/formula_ai.cpp Thu Apr 2 00:27:56 2009
@@ -2334,7 +2334,9 @@
std::vector<variant> vars;
for(unit_map::const_iterator i = get_info().units.begin(); i !=
get_info().units.end(); ++i) {
if(current_team().is_enemy(i->second.side())) {
- vars.push_back(variant(new unit_callable(*i)));
+ if (!i->second.incapacitated()) {
+ vars.push_back(variant(new
unit_callable(*i)));
+ }
}
}
return variant(&vars);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits