summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-05 16:39:16 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-05 16:39:16 +0000
commitd40afa4763689a1389db55f0a4e7952f89a53764 (patch)
tree71a36dbfecfc75d6644bcdb44d1ee1cbff21113c /crawl-ref
parentf6604b9ce1ec6e56c5fe5928d10dd0164a30fff6 (diff)
downloadcrawl-ref-d40afa4763689a1389db55f0a4e7952f89a53764.tar.gz
crawl-ref-d40afa4763689a1389db55f0a4e7952f89a53764.zip
[2000669] Fixing logic error that may have caused untargetable resting monsters to be created. If place_monster was called with force_pos, it could create monsters on top of other monsters. If that monster was resting (and thus never moved) and the first monster did move, the first monster would set mgrd to NON_MONSTER, making the resting monster untargetable.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6411 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/monplace.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index e5f7fb077e..c03517a98d 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -829,8 +829,8 @@ static int _place_monster_aux( const mgen_data &mg,
// If the space is occupied, try some neighbouring square instead.
if (first_band_member && in_bounds(mg.pos)
&& (mg.behaviour == BEH_FRIENDLY || !is_sanctuary(mg.pos.x, mg.pos.y))
- && (force_pos || mgrd(mg.pos) == NON_MONSTER && mg.pos != you.pos()
- && monster_habitable_grid(htype, grd(mg.pos))))
+ && mgrd(mg.pos) == NON_MONSTER && mg.pos != you.pos()
+ && (force_pos || monster_habitable_grid(htype, grd(mg.pos))))
{
fpos = mg.pos;
}