From d40afa4763689a1389db55f0a4e7952f89a53764 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sat, 5 Jul 2008 16:39:16 +0000 Subject: [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 --- crawl-ref/source/monplace.cc | 4 ++-- 1 file 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; } -- cgit v1.2.3-54-g00ecf