Skip to content

Commit

Permalink
fix #5414 issue
Browse files Browse the repository at this point in the history
fix attacker and defender formula pointed both' self'
  • Loading branch information
newfrenchy83 committed Jan 10, 2021
1 parent 2cf8ec6 commit b68b2e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/units/abilities.cpp
Expand Up @@ -475,7 +475,7 @@ void attack_type::add_formula_context(wfl::map_formula_callable& callable) const
if(unit_const_ptr & att = is_attacker_ ? self_ : other_) {
callable.add("attacker", wfl::variant(std::make_shared<wfl::unit_callable>(*att)));
}
if(unit_const_ptr & def = is_attacker_ ? self_ : other_) {
if(unit_const_ptr & def = !is_attacker_ ? self_ : other_) {
callable.add("defender", wfl::variant(std::make_shared<wfl::unit_callable>(*def)));
}
}
Expand Down

0 comments on commit b68b2e4

Please sign in to comment.