From f36915f1cabb3547931cdc206e8b575dc2d18944 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 2 Apr 2008 08:04:12 +0000 Subject: Fix tile compile on Windows. Fix crash when bottling !blood as a vampire. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4042 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/misc.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/misc.cc') diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 90f3d53e9e..489b507f6a 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -157,6 +157,9 @@ void turn_corpse_into_chunks( item_def &item ) create_monster_hide(mons_class); } +// Deliberately don't check for rottenness here, so this check +// can also be used to verify whether you *could* have bottled +// a now rotten corpse. bool can_bottle_blood_from_corpse(int mons_type) { if (you.species != SP_VAMPIRE || you.experience_level < 6 @@ -172,6 +175,8 @@ bool can_bottle_blood_from_corpse(int mons_type) return (false); } +// Maybe potions should automatically merge into those already on the floor, +// or the player's inventory. void turn_corpse_into_blood_potions( item_def &item ) { ASSERT( item.base_type == OBJ_CORPSES ); @@ -193,8 +198,8 @@ void turn_corpse_into_blood_potions( item_def &item ) // lower number of potions obtained from contaminated chunk type corpses if (mons_corpse_effect( mons_class ) == CE_CONTAMINATED) { - item.quantity /= random2(3); - + item.quantity /= (random2(3) + 1); + if (item.quantity < 1) item.quantity = 1; } -- cgit v1.2.3-54-g00ecf