summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-08 05:56:37 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-08 05:56:37 +0000
commit6d0956ae71b9cb324538d642616985487bffa892 (patch)
tree23e70a507f25d6b608b7d78858fbf96e089ddacc /crawl-ref/source/mon-util.cc
parent7fde3427574d5adbefa9473d3791517af63f78a2 (diff)
downloadcrawl-ref-6d0956ae71b9cb324538d642616985487bffa892.tar.gz
crawl-ref-6d0956ae71b9cb324538d642616985487bffa892.zip
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
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc14
1 files changed, 11 insertions, 3 deletions
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)