summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/it_use3.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-07 19:13:12 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-07 19:13:12 +0000
commit5d5389034da866a517b5d78095d5b1c7efb47e31 (patch)
treea57963c789bd723c3f24ee62c5f02fb3bc58db72 /crawl-ref/source/it_use3.cc
parent771ccf9a0c3660ec0a0ae1aaf3696367146d364c (diff)
downloadcrawl-ref-5d5389034da866a517b5d78095d5b1c7efb47e31.tar.gz
crawl-ref-5d5389034da866a517b5d78095d5b1c7efb47e31.zip
Make weapons of reaching work through granite statues again.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9913 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/it_use3.cc')
-rw-r--r--crawl-ref/source/it_use3.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc
index 77c91e5554..b0b1d34fa5 100644
--- a/crawl-ref/source/it_use3.cc
+++ b/crawl-ref/source/it_use3.cc
@@ -256,17 +256,26 @@ static bool _reaching_weapon_attack(const item_def& wpn)
}
const coord_def delta = beam.target - you.pos();
- const int x_distance = abs(delta.x);
- const int y_distance = abs(delta.y);
+ const int x_distance = abs(delta.x);
+ const int y_distance = abs(delta.y);
monsters* mons = monster_at(beam.target);
+ const int x_middle = std::max(beam.target.x, you.pos().x)
+ - (x_distance / 2);
+ const int y_middle = std::max(beam.target.y, you.pos().y)
+ - (y_distance / 2);
+ const coord_def middle(x_middle, y_middle);
+
if (x_distance > 2 || y_distance > 2)
{
mpr("Your weapon cannot reach that far!");
return (false);
}
- else if (!see_grid_no_trans(beam.target))
+ else if (!see_grid_no_trans(beam.target)
+ && grd(middle) <= DNGN_MAX_NONREACH)
{
+ // Might also be a granite statue/orcish idol which you
+ // can reach _past_.
mpr("There's a wall in the way.");
return (false);
}
@@ -285,12 +294,6 @@ static bool _reaching_weapon_attack(const item_def& wpn)
// If we're attacking more than a space away...
if (x_distance > 1 || y_distance > 1)
{
- const int x_middle = std::max(beam.target.x, you.pos().x)
- - (x_distance / 2);
- const int y_middle = std::max(beam.target.y, you.pos().y)
- - (y_distance / 2);
- const coord_def middle(x_middle, y_middle);
-
bool success = false;
// If either the x or the y is the same, we should check for
// a monster: