diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-26 11:27:16 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-26 11:27:16 +0000 |
commit | 12fa7099be089e42c8e1640eb9ac2c3c6afa97a2 (patch) | |
tree | b472b93a2035f3911289478d7577716d7492990a /crawl-ref/source/direct.cc | |
parent | 32e72edca686ce0f32d70c6418055fe14d5bd248 (diff) | |
download | crawl-ref-12fa7099be089e42c8e1640eb9ac2c3c6afa97a2.tar.gz crawl-ref-12fa7099be089e42c8e1640eb9ac2c3c6afa97a2.zip |
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
Diffstat (limited to 'crawl-ref/source/direct.cc')
-rw-r--r-- | crawl-ref/source/direct.cc | 18 |
1 files changed, 10 insertions, 8 deletions
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) { |