diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-29 11:26:03 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-29 11:26:03 +0000 |
commit | e3527ec5d93a7b5ff8ad9bb926cc9e1090715a39 (patch) | |
tree | a5a29493b84353e48d086fff754c85d60491f8f0 | |
parent | f945c65280cfb899a523faa5a510a897e2758ea0 (diff) | |
download | crawl-ref-e3527ec5d93a7b5ff8ad9bb926cc9e1090715a39.tar.gz crawl-ref-e3527ec5d93a7b5ff8ad9bb926cc9e1090715a39.zip |
Fix bug in shift_monster().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6714 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/monstuff.cc | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index b28420d6aa..e695b8974b 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -7911,19 +7911,8 @@ bool shift_monster( monsters *mon, int x, int y ) if (x == 0 && y == 0) { - // Try and find a random floor space some distance away. - for (i = 0; i < 50; i++) - { - tx = 5 + random2( GXM - 10 ); - ty = 5 + random2( GYM - 10 ); - - int dist = grid_distance(x, y, tx, ty); - if (grd[tx][ty] == DNGN_FLOOR && dist > 10) - break; - } - - if (i == 50) - return (false); + x = mon->x; + y = mon->y; } for (i = -1; i <= 1; i++) |