diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-06 00:55:02 -0600 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-06 00:55:02 -0600 |
commit | abc1c21beac74651d1a328c6846dc37aec0c016e (patch) | |
tree | 06932e8d0d3d9578de81bbe2bef28c499ecdf484 /crawl-ref/source/monster.cc | |
parent | f459b1b8e21346874ef3f82b0a7043c75c335e79 (diff) | |
download | crawl-ref-abc1c21beac74651d1a328c6846dc37aec0c016e.tar.gz crawl-ref-abc1c21beac74651d1a328c6846dc37aec0c016e.zip |
Move up the natural holiness/hellfire resistance check in is_evil().
Diffstat (limited to 'crawl-ref/source/monster.cc')
-rw-r--r-- | crawl-ref/source/monster.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index f7abb19d6b..a29c36b3be 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -2879,6 +2879,15 @@ bool monsters::is_evil() const if (is_unholy()) return (true); + // Assume that no natural creatures resist hellfire, except by evil + // means. + if (holiness() == MH_NATURAL) + { + const mon_resist_def res = get_mons_resists(this); + if (res.hellfire > 0) + return (true); + } + // Assume that all unknown gods (GOD_NAMELESS) are evil. if (is_priest() && (is_evil_god(god) || god == GOD_NAMELESS)) return (true); @@ -2892,15 +2901,6 @@ bool monsters::is_evil() const return (true); } - // Assume that no natural creatures resist hellfire, except by evil - // means. - if (holiness() == MH_NATURAL) - { - const mon_resist_def res = get_mons_resists(this); - if (res.hellfire) - return (true); - } - return (false); } |