Merge pull request #5415 from newfrenchy83/patch-6

fix WFL variables aren't getting assigned correctly
This commit is contained in:
Charles Dang 2021-01-11 04:24:03 +11:00 committed by GitHub
commit 47f6d15238
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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_ ? other_ : self_) {
callable.add("defender", wfl::variant(std::make_shared<wfl::unit_callable>(*def)));
}
}