diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-22 01:18:32 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-22 01:18:32 +0000 |
commit | 413367e626e7315ea2310daf60402ae8dde7ee54 (patch) | |
tree | ffa007fb1a180ea0ecf3d05e43883d35258fc533 /crawl-ref/source/spells3.cc | |
parent | 972dbbf367277c2106187ff5d08ab9544df173c8 (diff) | |
download | crawl-ref-413367e626e7315ea2310daf60402ae8dde7ee54.tar.gz crawl-ref-413367e626e7315ea2310daf60402ae8dde7ee54.zip |
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
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r-- | crawl-ref/source/spells3.cc | 16 |
1 files changed, 13 insertions, 3 deletions
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; |