summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorHaran Pilpel <haranp@users.sourceforge.net>2010-01-16 08:35:15 +0200
committerHaran Pilpel <haranp@users.sourceforge.net>2010-01-16 08:35:15 +0200
commit6dc4f972a25d496deecd55d60bee5ea31523d7dd (patch)
tree170e66e2122b10155cdc7a74b8bc204322511c27 /crawl-ref
parentcd1279820c73e2d44d5ca58f1cf62f2ee0bc769d (diff)
downloadcrawl-ref-6dc4f972a25d496deecd55d60bee5ea31523d7dd.tar.gz
crawl-ref-6dc4f972a25d496deecd55d60bee5ea31523d7dd.zip
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.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/mon-place.cc5
1 files changed, 5 insertions, 0 deletions
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)