diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-25 13:03:00 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-25 13:03:00 +0000 |
commit | e627cdb52f061a6bddf6213ce1ae564ce79deb72 (patch) | |
tree | 40dda1b756d40842115420d9fed0ae08d7d17149 /crawl-ref/source | |
parent | 46f47615625e1a81d15df96d4ccfe5ac6f697888 (diff) | |
download | crawl-ref-e627cdb52f061a6bddf6213ce1ae564ce79deb72.tar.gz crawl-ref-e627cdb52f061a6bddf6213ce1ae564ce79deb72.zip |
[1777018] Monster blink is now restricted to monster's LOS.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3333 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 6d7030559f..3398853f04 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1390,9 +1390,14 @@ bool monster_blink(monsters *monster) { int nx, ny; - if (!random_near_space(monster->x, monster->y, nx, ny, - false, false)) - return (false); + { + unwind_var<env_show_grid> visible_grid( env.show ); + losight(env.show, grd, monster->x, monster->y, true); + + if (!random_near_space(monster->x, monster->y, nx, ny, + false, true)) + return (false); + } if (mons_is_caught(monster)) mons_clear_trapping_net(monster); @@ -1412,7 +1417,7 @@ bool monster_blink(monsters *monster) monster->apply_location_effects(); return (true); -} // end monster_blink() +} // allow_adjacent: allow target to be adjacent to origin // restrict_LOS: restict target to be within PLAYER line of sight |