diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-09-28 21:46:04 -0500 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-09-28 21:46:04 -0500 |
commit | 6a8cc750190313fc4bdca7c1f257708f3298d20f (patch) | |
tree | bf807c87b73a34a01cb664aa4298b9a7197e55ac /crawl-ref/source/player.cc | |
parent | b64541c7ef4b9756015c499e6760afe3664de111 (diff) | |
download | crawl-ref-6a8cc750190313fc4bdca7c1f257708f3298d20f.tar.gz crawl-ref-6a8cc750190313fc4bdca7c1f257708f3298d20f.zip |
Simplify checks for whether players/monsters can hit monsters, and make
sure that the latter can properly hit monsters submerged in shallow
water if they have tentacles.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index a362419d2a..13161c94c7 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1093,13 +1093,11 @@ bool player_can_hit_monster(const monsters *mon) if (!mons_is_submerged(mon)) return (true); - if (grd(mon->pos()) == DNGN_SHALLOW_WATER) - { - const item_def *weapon = you.weapon(); - return (weapon && weapon_skill(*weapon) == SK_POLEARMS); - } + if (grd(mon->pos()) != DNGN_SHALLOW_WATER) + return (false); - return (false); + const item_def *weapon = you.weapon(); + return (weapon && weapon_skill(*weapon) == SK_POLEARMS); } int player_teleport(bool calc_unid) |