From 933b0c361d7ee4914b89e725a8886abb5f5e9d2c Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 23 Oct 2007 11:25:01 +0000 Subject: Fixed bad message with RAP_MAGICAL_POWER. Type safety; this required moving randart_prop_type to enum.h. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2518 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/item_use.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/item_use.cc') diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 2dcb74a054..69f8862bde 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3986,7 +3986,7 @@ void use_randart(item_def &item) // Only give property messages for previously unknown properties. if (proprt[RAP_AC]) { - you.redraw_armour_class = 1; + you.redraw_armour_class = true; if (!known[RAP_AC]) { mprf("You feel %s.", proprt[RAP_AC] > 0? @@ -3997,7 +3997,7 @@ void use_randart(item_def &item) if (proprt[RAP_EVASION]) { - you.redraw_evasion = 1; + you.redraw_evasion = true; if (!known[RAP_EVASION]) { mprf("You feel somewhat %s.", proprt[RAP_EVASION] > 0? @@ -4008,11 +4008,11 @@ void use_randart(item_def &item) if (proprt[RAP_MAGICAL_POWER]) { - you.redraw_magic_points = 1; + you.redraw_magic_points = true; if (!known[RAP_MAGICAL_POWER]) { - mprf("You feel your mana capacity %s.", proprt[RAP_EVASION] > 0? - "increase" : "decrease"); + mprf("You feel your mana capacity %s.", + proprt[RAP_MAGICAL_POWER] > 0? "increase" : "decrease"); randart_wpn_learn_prop(item, RAP_MAGICAL_POWER); } } @@ -4023,7 +4023,9 @@ void use_randart(item_def &item) modify_stat( STAT_INTELLIGENCE, proprt[RAP_INTELLIGENCE], false, item ); modify_stat( STAT_DEXTERITY, proprt[RAP_DEXTERITY], false, item ); - int stat_props[3] = {RAP_STRENGTH, RAP_INTELLIGENCE, RAP_DEXTERITY}; + const randart_prop_type stat_props[3] = + {RAP_STRENGTH, RAP_INTELLIGENCE, RAP_DEXTERITY}; + for (int i = 0; i < 3; i++) if (unknown_proprt(stat_props[i])) randart_wpn_learn_prop(item, stat_props[i]); -- cgit v1.2.3-54-g00ecf