From 12fa7099be089e42c8e1640eb9ac2c3c6afa97a2 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Wed, 26 Sep 2007 11:27:16 +0000 Subject: Removed hard tabs. Corrected sling bullet description. Targeting forward wrap-around was broken, fixed. Dropped damage bonus for kenku clawed-kick. Don't show {tried} for equipped items. Removed Elyvilon's protection from high-damage hits even when not praying. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2207 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/direct.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/direct.cc') diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index fb2884c267..7f4104878f 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -993,6 +993,10 @@ bool in_los(int x, int y) static bool find_monster( int x, int y, int mode ) { const int targ_mon = mgrd[ x ][ y ]; + if ((mode == TARG_FRIEND || mode == TARG_ANY) + && x == you.x_pos && y == you.y_pos) + return (true); + return (targ_mon != NON_MONSTER && in_los(x, y) && player_monster_visible( &(menv[targ_mon]) ) @@ -1158,24 +1162,22 @@ static char find_square( int xps, int yps, ctrx = vyou.x, ctry = vyou.y; while (temp_xps >= minx - 1 && temp_xps <= maxx - && temp_yps <= maxy && temp_yps >= miny - 1) + && temp_yps <= maxy && temp_yps >= miny - 1) { if (direction == 1 && temp_xps == minx && temp_yps == maxy) { - if (mode == TARG_ANY || mode == TARG_FRIEND) + if (find_targ(you.x_pos, you.y_pos, mode)) { - mfp[0] = vyou.x; - mfp[1] = vyou.y; + mfp[0] = ctrx; + mfp[1] = ctry; return (1); } return find_square(ctrx, ctry, mfp, direction, find_targ, mode, - false, next_los(direction, los, wrap)); + false, next_los(direction, los, wrap)); } if (direction == -1 && temp_xps == ctrx && temp_yps == ctry) - { return find_square(minx, maxy, mfp, direction, find_targ, mode, - false, next_los(direction, los, wrap)); - } + false, next_los(direction, los, wrap)); if (direction == 1) { -- cgit v1.2.3-54-g00ecf