have one. (They now either upgrade or simply ignore a second weapon, unless dual-wielding.)
Fix 2021307: Really get in some butchering before you get interrupted.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6604 c06c8d41-db1a-0410-9941-cceddc491573
JW5LVDYDDQMYLQLEB4WS7V3CV7FTHW7PSADCNY5JOJW4ZR34X6GQC
VCQYSNAWZZHOZMARWQ4AJBDNFSS7T7CZBQISSPZ2YIIK5PVAWPRQC
NRIZKLUO26UHNKB4IERXI6ECMD2IJYZACQNIUU3SH6BPLGHAJYVAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
QS3ZRS3E6KL3YJHPKYEWCWJYRBJSXD5OOYF6Y25HZVECGPJRDB5QC
47RJZCYIM3B7IXJT7FFT6NBZZREY6REK5DZWKZ5E7G66BXEXFN6QC
NVSFIV2ZKP44XHCSCXG6OZVGL67OIFINC34J2EMKTA4KULCERUEAC
RKFHYYANUZQHOWOE6YHVFFJNCZU7X67FWUQPQFF6KJKMNIKXFWEAC
R3ZUGT5VJ2DG5NFPG4RBWDWTULDE7L4REYSGVPHJPDXFG6OBIXYAC
DTO3EUKWHZ5RJNGNCFYXSOVTIPVXPP637F2W7WFGYKJ7JK7VNKNQC
5FZYO6GQ5DWJFMRHCFSLAI4NVGK2HJ6RE7BLHBVTNQJHN75K5LUQC
UET576SVCGS2TXEDRTO7BUTOTLJ77MYHIVZJCDWGH2BAXYMKG6DAC
// FIXME: A monster already wielding a melee weapon can put a second-rate
// weapon into its alternate slot but never use it.
// To fix this, this strange loop will have to be improved:
// - get weapons of first and second slot
// - compare weapons (or their non-existence) to the new one
// - ignore ranged weapons (we're picking up a melee weapon)
// - replace an existing melee weapon by a better one
// - else don't do anything
// Don't drop weapons specific to the monster.
if (_is_signature_weapon(this, *weap))
continue;
// If the new weapon is better than the current one, replace it.
// If wielding two weapons, replace the one with the lower dam. rating.
if (mons_weapon_damage_rating(*weap) < mdam_rating
&& ( eslot == -1 // current is main weapon
|| !weap->cursed()
&& mons_weapon_damage_rating(*weap)
< mons_weapon_damage_rating(*mslot_item(MSLOT_WEAPON)) ))
{
eslot = i;
// If the new weapon is better than the current one, replace it.
if (mons_weapon_damage_rating(*weap) < mdam_rating
&& !weap->cursed())
{
if (!dual_wielding
|| i == MSLOT_WEAPON
|| mons_weapon_damage_rating(*weap)
< mons_weapon_damage_rating(*mslot_item(MSLOT_WEAPON)))
{
eslot = i;
if (!dual_wielding)
break;
}
}
else if (!dual_wielding)
{
// We've got a good melee weapon, that's enough.
return (false);
}