fixed Bug #16102 - made AI cancel attack...

...if it's no longer valid due to WML at moveto. Needs backport
This commit is contained in:
Iurii Chernyi 2010-07-27 21:47:55 +00:00
parent b6530a5b0b
commit d94ff3e478

View file

@ -597,9 +597,14 @@ void combat_phase::execute()
}
}
attack_result_ptr attack_res = execute_attack_action(to, target_loc, -1);
attack_result_ptr attack_res = check_attack_action(to, target_loc, -1);
if (!attack_res->is_ok()) {
LOG_AI_TESTING_AI_DEFAULT << get_name() << "::execute not ok, attack failed" << std::endl;
LOG_AI_TESTING_AI_DEFAULT << get_name() << "::execute not ok, attack cancelled" << std::endl;
} else {
attack_res->execute();
if (!attack_res->is_ok()) {
LOG_AI_TESTING_AI_DEFAULT << get_name() << "::execute not ok, attack failed" << std::endl;
}
}
}