diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-02 08:04:12 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-02 08:04:12 +0000 |
commit | f36915f1cabb3547931cdc206e8b575dc2d18944 (patch) | |
tree | 5eaabe11c591004e10d059f3521a387053eba529 /crawl-ref/source/misc.cc | |
parent | fda9371e36ffcf798c20f134a883e6722d6340e3 (diff) | |
download | crawl-ref-f36915f1cabb3547931cdc206e8b575dc2d18944.tar.gz crawl-ref-f36915f1cabb3547931cdc206e8b575dc2d18944.zip |
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
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 9 |
1 files changed, 7 insertions, 2 deletions
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; } |