diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-23 02:18:57 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-23 02:20:52 -0800 |
commit | c58f6e940aa83c0e1c9e6bcc6614adcc0e2a4d79 (patch) | |
tree | b8eb6194e3595d4bdefaa5039eb3cce9e0cdb415 /crawl-ref/source/mon-place.cc | |
parent | f1c1f6fd2c8ab4238064dc3011bcbbc7286a8504 (diff) | |
download | crawl-ref-c58f6e940aa83c0e1c9e6bcc6614adcc0e2a4d79.tar.gz crawl-ref-c58f6e940aa83c0e1c9e6bcc6614adcc0e2a4d79.zip |
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.
Diffstat (limited to 'crawl-ref/source/mon-place.cc')
-rw-r--r-- | crawl-ref/source/mon-place.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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) |