From e627cdb52f061a6bddf6213ce1ae564ce79deb72 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Fri, 25 Jan 2008 13:03:00 +0000 Subject: [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 --- crawl-ref/source/monstuff.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') 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 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 -- cgit v1.2.3-54-g00ecf