From 413367e626e7315ea2310daf60402ae8dde7ee54 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 22 Jan 2009 01:18:32 +0000 Subject: Make stupid undead not pick up ranged weapons or missiles, since they can't use them. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8668 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells3.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/spells3.cc') diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 5b19bb4a44..3699d7945f 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -726,7 +726,12 @@ void equip_undead(const coord_def &a, int corps, int monster, int monnum) mslot = !weapon ? MSLOT_WEAPON : MSLOT_ALT_WEAPON; else mslot = MSLOT_WEAPON; - break; + + // Stupid undead can't use ranged weapons. + if (smart_undead || !is_range_weapon(item)) + break; + + continue; } case OBJ_ARMOUR: @@ -739,9 +744,14 @@ void equip_undead(const coord_def &a, int corps, int monster, int monnum) return; break; + // Stupid undead can't use missiles. case OBJ_MISSILES: - mslot = MSLOT_MISSILE; - break; + if (smart_undead) + { + mslot = MSLOT_MISSILE; + break; + } + continue; case OBJ_GOLD: mslot = MSLOT_GOLD; -- cgit v1.2.3-54-g00ecf