summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg-dgn.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-03-22 01:29:15 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-03-22 01:59:37 +0100
commitf88c6a77a058a02aff74443da3fd9c371877fbf3 (patch)
treece7816ba5fada182e723c537820f4542a08049c4 /crawl-ref/source/tilereg-dgn.cc
parentf22ecef8817a579eaba48747c8327f06424393bc (diff)
downloadcrawl-ref-f88c6a77a058a02aff74443da3fd9c371877fbf3.tar.gz
crawl-ref-f88c6a77a058a02aff74443da3fd9c371877fbf3.zip
Use actor->is_player() consistently instead of (actor->atype() == ACT_PLAYER).
Shorter and more readable. I did not change the similar comparison with ACT_MONSTER yet -- are we ever going to have other actor types? God acts may work as well with a fake monster, but multiplayer/arena can possibly want a third such type. On the other hand, code assumes that non-player implies monster and vice versa, though, so I'm probably worrying without a point.
Diffstat (limited to 'crawl-ref/source/tilereg-dgn.cc')
-rw-r--r--crawl-ref/source/tilereg-dgn.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/tilereg-dgn.cc b/crawl-ref/source/tilereg-dgn.cc
index 7d82d7e156..57083a78c7 100644
--- a/crawl-ref/source/tilereg-dgn.cc
+++ b/crawl-ref/source/tilereg-dgn.cc
@@ -416,7 +416,7 @@ static const bool _is_appropriate_spell(spell_type spell,
const bool helpful = flags & SPFLAG_HELPFUL;
- if (target->atype() == ACT_PLAYER)
+ if (target->is_player())
{
if (flags & SPFLAG_NOT_SELF)
return (false);
@@ -459,7 +459,7 @@ static const bool _is_appropriate_evokable(const item_def& item,
return (true);
spell_type spell = zap_type_to_spell(item.zap());
- if (spell == SPELL_TELEPORT_OTHER && target->atype() == ACT_PLAYER)
+ if (spell == SPELL_TELEPORT_OTHER && target->is_player())
spell = SPELL_TELEPORT_SELF;
return (_is_appropriate_spell(spell, target));