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:
parent
b6530a5b0b
commit
d94ff3e478
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue