Fix weapon specials marked as inactive
(cherry-picked from commit 902cf6dcfb
)
This commit is contained in:
parent
0e5eb5067e
commit
826a76a939
3 changed files with 6 additions and 5 deletions
|
@ -813,7 +813,7 @@ static int attack_info(reports::context & rc, const attack_type &at, config &res
|
|||
}
|
||||
|
||||
{
|
||||
auto ctx = at.specials_context_for_listing();
|
||||
auto ctx = at.specials_context_for_listing(u.side() == rc.screen().playing_side());
|
||||
boost::dynamic_bitset<> active;
|
||||
const std::vector<std::pair<t_string, t_string>> &specials = at.special_tooltips(&active);
|
||||
const std::size_t specials_size = specials.size();
|
||||
|
|
|
@ -785,10 +785,11 @@ attack_type::specials_context_t::specials_context_t(const attack_type& weapon, c
|
|||
weapon.is_for_listing_ = false;
|
||||
}
|
||||
|
||||
attack_type::specials_context_t::specials_context_t(const attack_type& weapon)
|
||||
attack_type::specials_context_t::specials_context_t(const attack_type& weapon, bool attacking)
|
||||
: parent(weapon.shared_from_this())
|
||||
{
|
||||
weapon.is_for_listing_ = true;
|
||||
weapon.is_attacker_ = attacking;
|
||||
}
|
||||
|
||||
attack_type::specials_context_t::~specials_context_t()
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
std::shared_ptr<const attack_type> parent;
|
||||
friend class attack_type;
|
||||
/// Initialize weapon specials context for listing
|
||||
explicit specials_context_t(const attack_type& weapon);
|
||||
explicit specials_context_t(const attack_type& weapon, bool attacking);
|
||||
/// Initialize weapon specials context for a unit type
|
||||
specials_context_t(const attack_type& weapon, const unit_type& self_type, const map_location& loc, bool attacking = true);
|
||||
/// Initialize weapon specials context for a single unit
|
||||
|
@ -144,8 +144,8 @@ public:
|
|||
specials_context_t specials_context(const unit_type& self_type, const map_location& loc, bool attacking = true) const {
|
||||
return specials_context_t(*this, self_type, loc, attacking);
|
||||
}
|
||||
specials_context_t specials_context_for_listing() const {
|
||||
return specials_context_t(*this);
|
||||
specials_context_t specials_context_for_listing(bool attacking = true) const {
|
||||
return specials_context_t(*this, attacking);
|
||||
}
|
||||
private:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue