mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 16:33:31 +00:00
fix attacks beein wrongly disabled
as said in the comment, that get_special_bool might return the wrong value, as since 5f58cd7c6d
the bc_vector no longer contains disabled attacks we can just remove this code.
fixes #3324
(cherry-picked from commit 44734570dd1824a098252d78dafc0f5a561c13cf)
This commit is contained in:
parent
7ecf55b6ed
commit
e3b4e1d911
@ -988,12 +988,7 @@ int mouse_handler::show_attack_dialog(const map_location& attacker_loc, const ma
|
||||
std::vector<battle_context> bc_vector;
|
||||
const int best = fill_weapon_choices(bc_vector, attacker, defender);
|
||||
|
||||
//TODO: this "disable" check has no attack context.
|
||||
const bool all_disabled = std::all_of(bc_vector.begin(), bc_vector.end(),
|
||||
[](battle_context& context) { return (*context.get_attacker_stats().weapon).get_special_bool("disable"); }
|
||||
);
|
||||
|
||||
if((*attacker).attacks().empty() || all_disabled) {
|
||||
if((*attacker).attacks().empty()) {
|
||||
gui2::show_transient_message("No Attacks", _("This unit has no usable weapons."));
|
||||
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user