summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-09 02:12:28 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-09 02:12:28 +0000
commit8d0ff904180d271bb7c87b46cfe728624cc5fba3 (patch)
tree36d2d7dde2e5a573697c017200a8c77a3ac44f15 /crawl-ref
parent187f5ddc800d1d8a779bbcfdb1af22f78f8c678d (diff)
downloadcrawl-ref-8d0ff904180d271bb7c87b46cfe728624cc5fba3.tar.gz
crawl-ref-8d0ff904180d271bb7c87b46cfe728624cc5fba3.zip
Apply zelgadis' fix from r5625 to three other places that need it.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5627 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/monstuff.cc8
-rw-r--r--crawl-ref/source/religion.cc8
-rw-r--r--crawl-ref/source/xom.cc8
3 files changed, 12 insertions, 12 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index a66f044d1e..dcb5f33d9b 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2985,13 +2985,13 @@ monsters *choose_random_monster_on_level(int weight,
if ( xstart < 0 ) xstart = 0;
if ( ystart < 0 ) ystart = 0;
- if ( xend >= GXM ) xend = GXM;
- if ( yend >= GYM ) yend = GYM;
+ if ( xend >= GXM ) xend = GXM - 1;
+ if ( yend >= GYM ) yend = GYM - 1;
}
// 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 )
if ( mgrd[x][y] != NON_MONSTER && (!in_sight || see_grid(x,y)) )
{
monsters *mon = &menv[mgrd[x][y]];
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 6a4dff77f6..cac1cdac33 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -4143,13 +4143,13 @@ static bool _beogh_followers_abandon_you()
int yend = you.y_pos + 9, xend = you.x_pos + 9;
if ( xstart < 0 ) xstart = 0;
if ( ystart < 0 ) ystart = 0;
- if ( xend >= GXM ) xend = GXM;
- if ( yend >= GYM ) yend = GYM;
+ if ( xend >= GXM ) xend = GXM - 1;
+ if ( yend >= GYM ) yend = GYM - 1;
// monster check
- for ( int y = ystart; y < yend; ++y )
+ for ( int y = ystart; y <= yend; ++y )
{
- for ( int x = xstart; x < xend; ++x )
+ for ( int x = xstart; x <= xend; ++x )
{
const unsigned short targ_monst = mgrd[x][y];
if ( targ_monst != NON_MONSTER )
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 09af8d47ed..4480bcafab 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -388,13 +388,13 @@ bool there_are_monsters_nearby()
int yend = you.y_pos + 9, xend = you.x_pos + 9;
if (xstart < 0) xstart = 0;
if (ystart < 0) ystart = 0;
- if (xend >= GXM) xend = GXM;
- if (yend >= GYM) yend = GYM;
+ if (xend >= GXM) xend = GXM - 1;
+ if (yend >= GYM) yend = GYM - 1;
// Monster check.
- for (int y = ystart; y < yend; ++y)
+ for (int y = ystart; y <= yend; ++y)
{
- for (int x = xstart; x < xend; ++x)
+ for (int x = xstart; x <= xend; ++x)
{
// If you can see a monster, then it's nearby.
if (see_grid(x, y))