cleanup_dead is true, do the cleanup.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8336 c06c8d41-db1a-0410-9941-cceddc491573
JM36UF5EFWQLT44YSLFAUM7IGILCC6WZHOBJOEL3HWIXGYLJRRXAC
EJZK7RJA2HE4S3SNFM2RDLT2UFVXJ64N5D2X7K2EUPSUS2UITB5AC
QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
5FHWTG7M6FW4B3I33YI7QSM3OZIB6ZGC6TI6JISSLY5Y43HI56VAC
IPYQUTCWLI46CL62UXHR6PULPO4JPPXPFAJCGZULBQM67SHGPXTAC
NVSFIV2ZKP44XHCSCXG6OZVGL67OIFINC34J2EMKTA4KULCERUEAC
JLAGD2FAV3CWVO7PLXTHLT7MBI23TUSYLSNHFAWP5IB5UO77VKJAC
// Already dead?
if (hit_points < 1 || type == -1)
return (0);
if (hit_points > 0 && type != -1)
{
if (amount == INSTANT_DEATH)
amount = hit_points;
else if (hit_dice <= 0)
amount = hit_points;
else if (amount <= 0 && hit_points <= max_hit_points)
return (0);
if (amount == INSTANT_DEATH)
amount = hit_points;
else if (hit_dice < 1)
amount = hit_points;
else if (amount <= 0 && hit_points <= max_hit_points)
return (0);
amount = std::min(amount, hit_points);
hit_points -= amount;
// Allow the victim to exhibit passive damage behaviour (royal jelly).
react_to_damage(amount, flavour);
if (cleanup_dead && (hit_points < 1 || hit_dice < 1) && type != -1)
if (cleanup_dead && (hit_points <= 0 || hit_dice <= 0) && type != -1)