From 6d0956ae71b9cb324538d642616985487bffa892 Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 8 Oct 2008 05:56:37 +0000 Subject: Allow monsters to properly pick up and use missile types that don't need launchers other than darts and stones. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7186 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mon-util.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/mon-util.cc') diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 9534760467..464abb8643 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3395,15 +3395,23 @@ bool monsters::can_use_missile(const item_def &item) const if (item.base_type != OBJ_MISSILES) return (false); - if (item.sub_type == MI_THROWING_NET && body_size(PSIZE_BODY) < SIZE_MEDIUM) + if ((item.sub_type == MI_THROWING_NET || item.sub_type == MI_JAVELIN) + && body_size(PSIZE_BODY) < SIZE_MEDIUM) + { return (false); + } if (item.sub_type == MI_LARGE_ROCK && !can_throw_rocks()) return (false); - // These don't need any launcher, and are always okay. - if (item.sub_type == MI_STONE || item.sub_type == MI_DART) + // Stones and darts don't need any launcher, and are always okay. + // Other missile types that don't need any launcher should be okay + // if we've gotten this far. + if (item.sub_type == MI_STONE || item.sub_type == MI_DART + || !has_launcher(item)) + { return (true); + } item_def *launch; for (int i = MSLOT_WEAPON; i <= MSLOT_ALT_WEAPON; ++i) -- cgit v1.2.3-54-g00ecf