diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-01 03:01:23 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-01 03:01:23 +0000 |
commit | b872c3121bce1e214ee313a594cb4a1a12f334ed (patch) | |
tree | 05bb9dcc9a3096d4cb2e9bfbe3ea8a9fd826ff6d /crawl-ref/source/mtransit.cc | |
parent | 46f119b34b1a6c5ec90e6b2d2de00eae1ef9678e (diff) | |
download | crawl-ref-b872c3121bce1e214ee313a594cb4a1a12f334ed.tar.gz crawl-ref-b872c3121bce1e214ee313a594cb4a1a12f334ed.zip |
Fix more monster placement problems: After falling down shafts, if the
monsters weren't placed near the player, they'd all be placed at the
same location, causing "floating monster" errors. Place them all *near*
that same location instead, and check for terrain the monster can
inhabit instead of just floor.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9298 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mtransit.cc')
-rw-r--r-- | crawl-ref/source/mtransit.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/crawl-ref/source/mtransit.cc b/crawl-ref/source/mtransit.cc index d43ad22022..5ce6d678a0 100644 --- a/crawl-ref/source/mtransit.cc +++ b/crawl-ref/source/mtransit.cc @@ -262,16 +262,12 @@ bool follower::place(bool near_player) dgn_find_nearby_stair(DNGN_ESCAPE_HATCH_DOWN, m.pos(), true); - if (monster_habitable_grid(&m, grd(where_to_go))) + if (where_to_go == you.pos()) + near_player = true; + else if (m.find_home_near_place(where_to_go)) { - if (where_to_go == you.pos()) - near_player = true; - else - { - m.moveto(where_to_go); - mgrd(where_to_go) = m.mindex(); - placed = true; - } + mgrd(m.pos()) = m.mindex(); + placed = true; } } |