From a0de356f3d007e58152f257212ed13d8b44fdfc0 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 1 Nov 2009 10:10:02 -0600 Subject: Move checks for a player or monster's being chaotic into another convenience function in the actor interface. --- crawl-ref/source/item_use.cc | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/item_use.cc') diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index e621b1e663..eb405b395e 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -42,9 +42,9 @@ #include "message.h" #include "misc.h" #include "mon-behv.h" +#include "mon-util.h" #include "monplace.h" #include "monstuff.h" -#include "mon-util.h" #include "notes.h" #include "ouch.h" #include "player.h" @@ -1710,17 +1710,7 @@ static bool _item_penetrates_victim(const bolt &beam, const actor *victim, static bool _silver_damages_victim(bolt &beam, actor* victim, int &dmg, std::string &dmg_msg) { - bool chaotic; - - if (victim->atype() == ACT_MONSTER) - { - monsters* mon = dynamic_cast(victim); - chaotic = mons_is_chaotic(mon); // Includes shapeshifters. - } - else - chaotic = transform_changed_physiology(); - - if (chaotic || victim->is_unholy()) + if (victim->is_unholy() || victim->is_chaotic()) { dmg *= 2; -- cgit v1.2.3-54-g00ecf