diff options
author | Neil Moore <neil@s-z.org> | 2014-06-19 12:30:41 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-06-19 12:31:00 -0400 |
commit | 85638fe5c455f3e52450ce4273aad8e297189d42 (patch) | |
tree | c3b2aeb8b74e76b11439ae27772a5379556abc0c /crawl-ref/source/spl-summoning.cc | |
parent | 61e7c1565861f7a89ca6f0554d135d64ec55a6fe (diff) | |
download | crawl-ref-85638fe5c455f3e52450ce4273aad8e297189d42.tar.gz crawl-ref-85638fe5c455f3e52450ce4273aad8e297189d42.zip |
Don't crash when there's no spot to animate a weapon into.
Also when there are too many monsters on the level, etc.
Diffstat (limited to 'crawl-ref/source/spl-summoning.cc')
-rw-r--r-- | crawl-ref/source/spl-summoning.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/spl-summoning.cc b/crawl-ref/source/spl-summoning.cc index 621c0a54d2..71c4fe5c56 100644 --- a/crawl-ref/source/spl-summoning.cc +++ b/crawl-ref/source/spl-summoning.cc @@ -843,6 +843,13 @@ static void _animate_weapon(int pow, actor* target, bool force_friendly) monster *mons = create_monster(mg); + if (!mons) + { + mprf("%s twitches for a moment.", + _get_item_desc(wpn, target_is_player).c_str()); + return; + } + // Don't haunt yourself if the weapon is friendly if (!force_friendly) { |