Fixed bug #13295. enemy_units formula now ignores incapacitated units,

such as statues in the 'Caves of The Basilisk'
This commit is contained in:
Iurii Chernyi 2009-04-01 22:27:56 +00:00
parent 531fefdc25
commit e03e86bb4e
2 changed files with 5 additions and 1 deletions

View File

@ -19,6 +19,8 @@ Version 1.7.0-svn:
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

View File

@ -2334,7 +2334,9 @@ variant formula_ai::get_value(const std::string& key) const
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);