From 6dc4f972a25d496deecd55d60bee5ea31523d7dd Mon Sep 17 00:00:00 2001 From: Haran Pilpel Date: Sat, 16 Jan 2010 08:35:15 +0200 Subject: Fix for bug 438: when drawing Dance, and probably creating dancing weapons in other ways too, we would call _maybe_init_tilenum_props, which tries to get the basetile for the dancing weapon, which crashes because we haven't given it the weapon yet (this was all happening in create_monster().) This is a major hack; someone more familiar with tiles should fix this better. --- crawl-ref/source/mon-place.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crawl-ref') diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc index 36be19cdeb..24abc3771c 100644 --- a/crawl-ref/source/mon-place.cc +++ b/crawl-ref/source/mon-place.cc @@ -1068,6 +1068,11 @@ 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) + return; + // Only add the property for tiles that have several variants. const int base_tile = tileidx_monster_base(mon); if (tile_player_count(base_tile) > 1) -- cgit v1.2.3-54-g00ecf