diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-30 14:53:42 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-30 14:53:42 +0000 |
commit | 7c3ec6bed4e81892c772db3e33d30f09164e7bb3 (patch) | |
tree | 171d041b2c38cfd7ad417d40181f718d16841b3b | |
parent | 7cd6623f97a35ace8b72b9baf7966ebd4f8f3d5d (diff) | |
download | crawl-ref-7c3ec6bed4e81892c772db3e33d30f09164e7bb3.tar.gz crawl-ref-7c3ec6bed4e81892c772db3e33d30f09164e7bb3.zip |
Fix 2006479: worn unidentified =PR marking poisonous food as safe.
Fix 2006014: character selection crashing after non-random book choice.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6248 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/food.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/itemname.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/newgame.cc | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 07e8740533..7a20b95fbe 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -1846,7 +1846,7 @@ bool is_poisonous(const item_def &food) if (food.base_type != OBJ_FOOD && food.base_type != OBJ_CORPSES) return (false); - if (player_res_poison()) + if (player_res_poison(false)) return (false); return (mons_corpse_effect(food.plus) == CE_POISONOUS); diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index a7e2b459e4..1e0c1310d9 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2305,7 +2305,7 @@ bool is_bad_item(const item_def &item, bool temp) case POT_POISON: case POT_STRONG_POISON: // Poison is not that bad if you're poison resistant. - return (!player_res_poison() + return (!player_res_poison(false) || !temp && you.species == SP_VAMPIRE); case POT_MUTATION: return (you.is_undead @@ -2447,7 +2447,7 @@ bool is_useless_item(const item_def &item, bool temp) case POT_POISON: case POT_STRONG_POISON: // If you're poison resistant, poison is only useless. - return player_res_poison(); + return player_res_poison(false); } return (false); @@ -2482,7 +2482,7 @@ bool is_useless_item(const item_def &item, bool temp) return (player_mutation_level(MUT_ACUTE_VISION)); case RING_POISON_RESISTANCE: - return (player_res_poison(true, temp, false) + return (player_res_poison(false, temp, false) && (temp || you.species != SP_VAMPIRE)); case AMU_CONTROLLED_FLIGHT: diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index b2327bc9ae..8e8ed3ed92 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -2121,9 +2121,11 @@ static bool _choose_book( item_def& book, int firstbook, int numbooks ) if (!good_choices) keyin = random2(numbooks); + + keyin += 'a'; } - book.sub_type = firstbook + keyin; + book.sub_type = firstbook + keyin - 'a'; return (true); } |