diff options
author | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2010-01-16 23:39:29 +0100 |
---|---|---|
committer | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2010-01-16 23:44:52 +0100 |
commit | 4797da8a59e72ab44e0b9ad71bbb491e1d18b875 (patch) | |
tree | d8f8f76094328d0ff5c5cd9cec4d62d03811f9d5 /crawl-ref | |
parent | 888b4555a4cea7a0b3a0034e6dfc8cb8210c74b1 (diff) | |
download | crawl-ref-4797da8a59e72ab44e0b9ad71bbb491e1d18b875.tar.gz crawl-ref-4797da8a59e72ab44e0b9ad71bbb491e1d18b875.zip |
Specialcase mimics and dancing weapons in tilenum initialisation.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/mon-place.cc | 11 |
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. |