summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monster.cc
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-08-03 13:59:36 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-08-03 14:17:14 -0400
commit2e52a0c19d866a6a15b36163fa145a94bbf9721f (patch)
tree1ad40aea10861227400db415ab1c2adaef44252b /crawl-ref/source/monster.cc
parent2091673ee858097442a1668a947626a489639ece (diff)
downloadcrawl-ref-2e52a0c19d866a6a15b36163fa145a94bbf9721f.tar.gz
crawl-ref-2e52a0c19d866a6a15b36163fa145a94bbf9721f.zip
Hide a hack better.
Ideally, we wouldn't be using special for unrands totally different from how items of the same type do, but that's less trivial than this commit. A centralised place to check for being an unrand should at least make such a change easier.
Diffstat (limited to 'crawl-ref/source/monster.cc')
-rw-r--r--crawl-ref/source/monster.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 4a8365c6ec..50b12e93cd 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -1537,8 +1537,7 @@ static bool _is_signature_weapon(const monster* mons, const item_def &weapon)
{
return weapon.base_type == OBJ_STAVES
&& weapon.sub_type == STAFF_POISON
- || weapon.base_type == OBJ_WEAPONS
- && weapon.special == UNRAND_OLGREB;
+ || is_unrandom_artefact(weapon, UNRAND_OLGREB);
}
if (mons->type == MONS_FANNAR)
@@ -2978,7 +2977,7 @@ bool monster::go_berserk(bool intentional, bool /* potion */)
if (const item_def* w = weapon())
{
- if (is_unrandom_artefact(*w) && w->special == UNRAND_JIHAD)
+ if (is_unrandom_artefact(*w, UNRAND_JIHAD))
for (actor_near_iterator mi(pos(), LOS_NO_TRANS); mi; ++mi)
if (mons_aligned(this, *mi))
mi->go_berserk(false);