summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-09 01:52:58 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-09 01:52:58 +0000
commit15431f7e0c81d5df0144ab511c3cbd52b7e1d7cc (patch)
treeaa070921055190ce211d9ed36a7e9b031ca34aa2 /crawl-ref/source/misc.cc
parent086ba6c2bab2012096f899b22d280c544450366b (diff)
downloadcrawl-ref-15431f7e0c81d5df0144ab511c3cbd52b7e1d7cc.tar.gz
crawl-ref-15431f7e0c81d5df0144ab511c3cbd52b7e1d7cc.zip
Fixed problem with monsters on edge of vision not being listed. Might
be bug 1946671. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5625 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 40ffda768f..cfd8e6a52e 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2666,14 +2666,14 @@ void get_playervisible_monsters(std::vector<monsters*> &mons,
if (range == -1)
range = LOS_RADIUS;
- const int ystart = MAX(0, you.y_pos - range);
- const int yend = MIN(GYM, you.y_pos + range);
- const int xstart = MAX(0, you.x_pos - range);
- const int xend = MIN(GXM, you.x_pos + range);
+ const int ystart = MAX(0, you.y_pos - range);
+ const int yend = MIN(GYM - 1, you.y_pos + range);
+ const int xstart = MAX(0, you.x_pos - range);
+ const int xend = MIN(GXM - 1, you.x_pos + range);
// Monster check.
- for (int y = ystart; y < yend; ++y)
- for (int x = xstart; x < xend; ++x)
+ for (int y = ystart; y <= yend; y++)
+ for (int x = xstart; x <= xend; x++)
{
const unsigned short targ_monst = env.mgrid[x][y];
if (targ_monst != NON_MONSTER)