From 942a2a13a9bbe4672247b37e58a53abfc4ca4db5 Mon Sep 17 00:00:00 2001 From: haranp Date: Thu, 29 Jan 2009 12:57:33 +0000 Subject: Clean up potion effects as per [2544231]; get rid of the "power == 40 means it's a potion" hack. Fix security issue in dumping code (never dump a string without using %s.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8846 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/decks.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/decks.cc') diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index a8a95a2441..d6e119a473 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -1839,9 +1839,9 @@ static void _elixir_card(int power, deck_rarity_type rarity) if (power_level == 0) { if (coinflip()) - potion_effect( POT_HEAL_WOUNDS, 40 ); // power doesn't matter + potion_effect(POT_HEAL_WOUNDS, 40); // power doesn't matter else - cast_regen( random2(power / 4) ); + cast_regen(random2(power / 4)); } else if (power_level == 1) { @@ -2572,9 +2572,7 @@ static void _genie_card(int power, deck_rarity_type rarity) { mpr("A genie takes form and thunders: " "\"You disturbed me, fool!\""); - // Use 41, not 40, to tell potion_effect() that this isn't a - // real potion. - potion_effect( coinflip() ? POT_DEGENERATION : POT_DECAY, 41 ); + potion_effect(coinflip() ? POT_DEGENERATION : POT_DECAY, 40); } } -- cgit v1.2.3-54-g00ecf