Attack Enemy: Don't show "poison" in the attacks list if the enemy is unpoisonable.

This commit is contained in:
josteph 2018-11-03 19:13:52 +00:00 committed by jostephd
parent 5ab1bac38c
commit 526d22648e

View file

@ -1027,6 +1027,11 @@ bool attack_type::special_active(const config& special, AFFECTS whom,
temporary_facing self_facing(self, self_loc_.get_relative_dir(other_loc_));
temporary_facing other_facing(other, other_loc_.get_relative_dir(self_loc_));
// Filter poison
if (special["id"] == "poison" && other && other->get_state("unpoisonable")) {
return false;
}
// Translate our context into terms of "attacker" and "defender".
unit_const_ptr & att = is_attacker_ ? self : other;
unit_const_ptr & def = is_attacker_ ? other : self;