summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 9f87b8bb5f..7c3fd563d8 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4345,6 +4345,19 @@ bool monsters::pickup(item_def &item, int slot, int near, bool force_merge)
return (false);
}
+ // Similarly, monsters won't pick up shields if they're
+ // wielding (or alt-wielding) a two-handed weapon.
+ if (slot == MSLOT_SHIELD)
+ {
+ const item_def* wpn = mslot_item(MSLOT_WEAPON);
+ const item_def* alt = mslot_item(MSLOT_ALT_WEAPON);
+ if (wpn && hands_reqd(*wpn, body_size(PSIZE_BODY)) == HANDS_TWO)
+ return false;
+
+ if (alt && hands_reqd(*alt, body_size(PSIZE_BODY)) == HANDS_TWO)
+ return false;
+ }
+
if (inv[slot] != NON_ITEM)
{
item_def &dest(mitm[inv[slot]]);