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/delay.cc | 10 ++++++++-- crawl-ref/source/misc.cc | 9 +++++++-- crawl-ref/source/travel.cc | 2 +- crawl-ref/source/view.cc | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 822b77c358..e3b1d677ac 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -615,12 +615,18 @@ void handle_delay( void ) mpr("The corpse rots.", MSGCH_ROTTEN_MEAT); delay.parm2 = 99; // don't give the message twice - if (you.species != SP_VAMPIRE - && you.is_undead != US_UNDEAD + if (you.is_undead != US_UNDEAD && you.mutation[MUT_SAPROVOROUS] < 3) { xom_check_corpse_waste(); } + // Vampires won't continue bottling rotting corpses. + if (can_bottle_blood_from_corpse(mitm[delay.parm1].plus)) + { + mpr("You stop bottling this corpse's foul smelling " + "blood!"); + delay.duration = 0; + } } // mark work done on the corpse in case we stop -- bwr 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; } diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 332727cb0e..fabc3e436c 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -227,7 +227,7 @@ static bool is_excluded(const coord_def &p, return (false); } -inline bool is_excluded(const coord_def &p) +bool is_excluded(const coord_def &p) { return is_excluded(p, curr_excludes); } diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index a4e00b5885..2a79c9fd4c 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -4680,7 +4680,7 @@ void viewwindow(bool draw_it, bool do_updates) buffy[bufcount + 1] = DARKGREY; if (Options.colour_map) - { + { buffy[bufcount + 1] = colour_code_map(gc.x, gc.y, Options.item_colour); } -- cgit v1.2.3-54-g00ecf