diff options
author | Vsevolod Kozlov <zaba@thorium.homeunix.org> | 2009-11-09 14:33:06 +0300 |
---|---|---|
committer | Vsevolod Kozlov <zaba@thorium.homeunix.org> | 2009-11-09 14:58:19 +0300 |
commit | 9338556ebf846bbc4176134e3846ef6699e8434b (patch) | |
tree | 2107949166730a765e3e1e98a66778f112fb5e6a /crawl-ref/source/mon-util.cc | |
parent | bf03515e22d610f81afa6d4153afc383f7331363 (diff) | |
download | crawl-ref-9338556ebf846bbc4176134e3846ef6699e8434b.tar.gz crawl-ref-9338556ebf846bbc4176134e3846ef6699e8434b.zip |
Replace mons_wont_attack with monsters::wont_attack.
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 834f6a9e90..64e6e167ff 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1956,11 +1956,6 @@ bool mons_is_pacified(const monsters *m) return (m->attitude == ATT_NEUTRAL && testbits(m->flags, MF_GOT_HALF_XP)); } -bool mons_wont_attack(const monsters *m) -{ - return (m->friendly() || m->good_neutral() || m->strict_neutral()); -} - bool mons_att_wont_attack(mon_attitude_type fr) { return (fr == ATT_FRIENDLY || fr == ATT_GOOD_NEUTRAL || fr == ATT_STRICT_NEUTRAL); @@ -2018,7 +2013,7 @@ bool mons_is_lurking(const monsters *m) bool mons_is_influenced_by_sanctuary(const monsters *m) { - return (!mons_wont_attack(m) + return (!m->wont_attack() && (m->holiness() != MH_PLANT || mons_is_stationary(m))); } @@ -2309,7 +2304,7 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell ) return (true); } - if (!mons_wont_attack(mon)) + if (!mon->wont_attack()) { if (spell_harms_area(monspell) && env.sanctuary_time > 0) return (true); @@ -2986,7 +2981,7 @@ std::string do_mon_str_replacements(const std::string &in_msg, { std::string msg = in_msg; - const actor* foe = (mons_wont_attack(monster) + const actor* foe = (monster->wont_attack() && invalid_monster_index(monster->foe)) ? &you : monster->get_foe(); |