Fix some calls to unit::get_ability_bool().

The callers were not aware of that the function expects a tag name instead
of an ability id. The function catches more cases of the unit having
the ability than what the callers were expecting, supposedly.

(Being granted by a nearby unit.)

see http://forums.wesnoth.org/viewtopic.php?p=519206&sid=8f07f9142de08853f8eb60d71f95d8da#p519206
This commit is contained in:
Anonymissimus 2012-01-23 15:09:23 +00:00
parent 5a94a5ac3b
commit 92495e5f39
2 changed files with 3 additions and 3 deletions

View file

@ -114,7 +114,7 @@ int default_ai_context_impl::rate_terrain(const unit& u, const map_location& loc
const int neutral_village_value = 10;
const int enemy_village_value = 15;
if(map_.gives_healing(terrain) && u.get_ability_bool("regenerates",loc) == false) {
if(map_.gives_healing(terrain) && u.get_ability_bool("regenerate",loc) == false) {
rating += healing_value;
}

View file

@ -282,7 +282,7 @@ void aspect_attacks::do_attack_analysis(
}
// No surround bonus if target is skirmisher
if (!itor->get_ability_bool("skirmisker"))
if (!itor->get_ability_bool("skirmisher"))
surround_bonus = 1.2;
}
@ -373,7 +373,7 @@ int aspect_attacks::rate_terrain(const unit& u, const map_location& loc)
const int neutral_village_value = 10;
const int enemy_village_value = 15;
if(map_.gives_healing(terrain) && u.get_ability_bool("regenerates",loc) == false) {
if(map_.gives_healing(terrain) && u.get_ability_bool("regenerate",loc) == false) {
rating += healing_value;
}