summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-project.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-07-09 11:57:30 +0100
committerChris Campbell <chriscampbell89@gmail.com>2014-07-09 14:20:05 +0100
commit28beea6b951314f59ca6018dedc0d0cb87f0eac2 (patch)
tree9d14deef2eaeafecedfb7e7e386af1350c863fef /crawl-ref/source/mon-project.cc
parent16e9270f56188ed993ec5a9755fe3874158ab40c (diff)
downloadcrawl-ref-28beea6b951314f59ca6018dedc0d0cb87f0eac2.tar.gz
crawl-ref-28beea6b951314f59ca6018dedc0d0cb87f0eac2.zip
Fix magical shields being unable to block most ranged attacks (#8772)
They checked that the player either had a shield equipped or had the bone plates mutation, so TSO's divine shield, Qazlal shielding and Condensation shield could all never block ranged attacks (except for those from ranged weapons, since those now follow the same codepath as melee attacks!).
Diffstat (limited to 'crawl-ref/source/mon-project.cc')
-rw-r--r--crawl-ref/source/mon-project.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc
index 6d4e4bb3a4..fad0a806df 100644
--- a/crawl-ref/source/mon-project.cc
+++ b/crawl-ref/source/mon-project.cc
@@ -199,7 +199,7 @@ static void _fuzz_direction(const actor *caster, monster& mon, int pow)
// Alas, too much differs to reuse beam shield blocks :(
static bool _iood_shielded(monster& mon, actor &victim)
{
- if (!victim.shield() || victim.incapacitated())
+ if (!victim.shielded() || victim.incapacitated())
return false;
const int to_hit = 15 + (mons_is_projectile(mon.type) ?
@@ -507,7 +507,7 @@ move_again:
if (victim && _iood_shielded(mon, *victim))
{
item_def *shield = victim->shield();
- if (!shield_reflects(*shield))
+ if (!shield || !shield_reflects(*shield))
{
if (victim->is_player())
mprf("You block %s.", mon.name(DESC_THE, true).c_str());