diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-28 16:22:09 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-28 16:22:09 +0000 |
commit | 990a102363ff38bf95ed78baf777f2a7ba57e62c (patch) | |
tree | b839161145ae80ab232f6bd6e5c39dd0c2351a19 /crawl-ref/source | |
parent | 2367c6063d5007494524711946e83a832b562076 (diff) | |
download | crawl-ref-990a102363ff38bf95ed78baf777f2a7ba57e62c.tar.gz crawl-ref-990a102363ff38bf95ed78baf777f2a7ba57e62c.zip |
[1834349] Fixed reaching going through walls.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2924 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/it_use3.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index 7b1f4fba04..161782ce0e 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -275,6 +275,11 @@ static bool reaching_weapon_attack(const item_def& wpn) mpr("Your weapon cannot reach that far!"); return false; } + else if (!see_grid_no_trans(beam.tx, beam.ty)) + { + mpr("There's a wall in the way."); + return (false); + } else if (mgrd[beam.tx][beam.ty] == NON_MONSTER) { // Must return true, otherwise you get a free discovery diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 928f05e50a..87f3b4c336 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -2965,7 +2965,8 @@ static bool handle_reaching(monsters *monster) if (monster->foe == MHITYOU) { // this check isn't redundant -- player may be invisible. - if (monster->target_x == you.x_pos && monster->target_y == you.y_pos) + if (monster->target_pos() == you.pos() + && see_grid_no_trans(monster->pos())) { int dx = abs(monster->x - you.x_pos); int dy = abs(monster->y - you.y_pos); |