summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-04 05:42:35 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-04 05:42:35 +0000
commitf56a2f7730f39719c1e57f4dac08d0f9c5821432 (patch)
tree51ed65a276dd214d1b7c68b8561c2f4b246e5437 /crawl-ref/source/dungeon.cc
parentf7fb0796e6b7287f2adb0a7fe02ced6a4b0af6bc (diff)
downloadcrawl-ref-f56a2f7730f39719c1e57f4dac08d0f9c5821432.tar.gz
crawl-ref-f56a2f7730f39719c1e57f4dac08d0f9c5821432.zip
[2484833] Fix being unable to generate multiple random monsters for arena.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8196 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 00f025fa9a..5d4f52fa41 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4549,12 +4549,14 @@ int dgn_place_monster(mons_spec &mspec,
coord_def place(where);
if (!force_pos && mgrd(place) != NON_MONSTER
- && mg.cls != RANDOM_MONSTER && mg.cls < NUM_MONSTERS)
+ && (mg.cls < NUM_MONSTERS || mg.cls == RANDOM_MONSTER))
{
- place = find_newmons_square_contiguous(mg.cls, where, 0);
+ const monster_type habitat_target =
+ mg.cls == RANDOM_MONSTER ? MONS_GIANT_BAT : mg.cls;
+ place = find_newmons_square_contiguous(habitat_target, where, 0);
}
- mg.pos = place;
+ mg.pos = place;
if (mons_class_is_zombified(mg.base_type))
{