From c58f6e940aa83c0e1c9e6bcc6614adcc0e2a4d79 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Mon, 23 Nov 2009 02:18:57 -0800 Subject: Don't crash for Beogh dancing weapons in clouds create_monster(), when trying to avoid placing Beogh wrath dancing weapons into dangerous clouds, would crash because the dummy dancing weapon it created didn't have it's demon_ghost setup. See bug #17. --- crawl-ref/source/mon-place.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc index 499d5e1973..dbfad61e5c 100644 --- a/crawl-ref/source/mon-place.cc +++ b/crawl-ref/source/mon-place.cc @@ -2769,6 +2769,13 @@ int create_monster(mgen_data mg, bool fail_msg) dummy.base_monster = mg.base_type; dummy.god = mg.god; + // FIXME: resistence checks use the ghost_demon member for + // monster types that use it, so a call to mons_avoids_cloud() + // will crash for dummy monsters which should have a + // ghost_demon setup. + if (mons_is_ghost_demon(dummy.type)) + return (-1); + int tries = 0; while (tries++ < 50 && (!in_bounds(mg.pos) -- cgit v1.2.3-54-g00ecf