summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-01-16 23:39:29 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-01-16 23:44:52 +0100
commit4797da8a59e72ab44e0b9ad71bbb491e1d18b875 (patch)
treed8f8f76094328d0ff5c5cd9cec4d62d03811f9d5
parent888b4555a4cea7a0b3a0034e6dfc8cb8210c74b1 (diff)
downloadcrawl-ref-4797da8a59e72ab44e0b9ad71bbb491e1d18b875.tar.gz
crawl-ref-4797da8a59e72ab44e0b9ad71bbb491e1d18b875.zip
Specialcase mimics and dancing weapons in tilenum initialisation.
-rw-r--r--crawl-ref/source/mon-place.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index 24abc3771c..2c329e544a 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -712,9 +712,8 @@ static int _is_near_stairs(coord_def &p)
// is true, then we'll be less rigorous in our checks, in particular
// allowing land monsters to be placed in shallow water and water
// creatures in fountains.
-static bool _valid_monster_generation_location(
- const mgen_data &mg,
- const coord_def &mg_pos)
+static bool _valid_monster_generation_location( const mgen_data &mg,
+ const coord_def &mg_pos)
{
if (!in_bounds(mg_pos) || actor_at(mg_pos))
return (false);
@@ -1056,6 +1055,7 @@ monsters* get_free_monster()
env.mons[i].reset();
return (&env.mons[i]);
}
+
return (NULL);
}
@@ -1068,9 +1068,8 @@ static void _maybe_init_tilenum_props(monsters *mon)
if (mon->props.exists("monster_tile") || mon->props.exists("tile_num"))
return;
- // FIXME: special-case hack to prevent dancing weapons from causing
- // a crash.
- if (mon->type == MONS_DANCING_WEAPON)
+ // Special-case for monsters masquerading as items.
+ if (mon->type == MONS_DANCING_WEAPON || mons_is_mimic(mon->type))
return;
// Only add the property for tiles that have several variants.