diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-18 03:08:45 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-18 03:08:45 +0000 |
commit | c6b621bf1bfc70baa0ea87b15e4e4656c6a43457 (patch) | |
tree | 575b8d006b0d5ef217723fc3144e4397fe1fa6c2 /crawl-ref/source/stuff.cc | |
parent | a8aa8841073e62b9404166a164fc54cd476ace02 (diff) | |
download | crawl-ref-c6b621bf1bfc70baa0ea87b15e4e4656c6a43457.tar.gz crawl-ref-c6b621bf1bfc70baa0ea87b15e4e4656c6a43457.zip |
Add more miscellaneous minor fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5931 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stuff.cc')
-rw-r--r-- | crawl-ref/source/stuff.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index df64a4e24d..a261bdbf06 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -1493,13 +1493,14 @@ int fuzz_value(int val, int lowfuzz, int highfuzz, int naverage) // Returns 0 if the point is not near stairs. // Returns 1 if the point is near unoccupied stairs. // Returns 2 if the point is near player-occupied stairs. -int near_stairs(const coord_def &p, int max_dist, - dungeon_char_type &stair_type, - branch_type &branch) +int near_stairs(const coord_def &p, int max_dist, bool allow_hatches, + dungeon_char_type &stair_type, branch_type *branch) { coord_def inc; - for (inc.x = -max_dist; inc.x <= max_dist; inc.x++) - for (inc.y = -max_dist; inc.y <= max_dist; inc.y++) + + for (inc.x = -max_dist; inc.x <= max_dist; ++inc.x) + { + for (inc.y = -max_dist; inc.y <= max_dist; ++inc.y) { const coord_def np(p + inc); @@ -1529,9 +1530,10 @@ int near_stairs(const coord_def &p, int max_dist, break; } } - return (np == you.pos()? 2 : 1); + return (np == you.pos()) ? 2 : 1; } } + } return false; } |