summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-23 19:03:38 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-23 19:03:38 +0000
commit2055942d4ba70adfd48f939b2a6d140f2329a2b6 (patch)
tree6ae91f77c6187f9f1f794ff3a61f0d1418659027 /crawl-ref/source/item_use.cc
parent02c09a0128b64954a83c90827e12e1d5ec18468f (diff)
downloadcrawl-ref-2055942d4ba70adfd48f939b2a6d140f2329a2b6.tar.gz
crawl-ref-2055942d4ba70adfd48f939b2a6d140f2329a2b6.zip
In enchant_weapon(), use the quiet parameter properly in all cases.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3837 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index b304a06545..f818edac69 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -3816,11 +3816,11 @@ bool enchant_weapon( enchant_stat_type which_stat, bool quiet, int wpn )
{
if (wpn == -1)
wpn = you.equip[ EQ_WEAPON ];
-
+
bool affected = true;
int enchant_level;
- if (wpn == -1
+ if (wpn == -1
|| (you.inv[ wpn ].base_type != OBJ_WEAPONS
&& you.inv[ wpn ].base_type != OBJ_MISSILES))
{
@@ -3857,7 +3857,7 @@ bool enchant_weapon( enchant_stat_type which_stat, bool quiet, int wpn )
}
// if it isn't affected by the enchantment, it will still
- // be uncursed:
+ // be uncursed.
if (!affected)
{
if (item_cursed(item))
@@ -3905,8 +3905,11 @@ bool enchant_weapon( enchant_stat_type which_stat, bool quiet, int wpn )
}
else if (item.base_type == OBJ_MISSILES)
{
- mprf("%s %s red for a moment.", iname.c_str(),
- item.quantity > 1 ? "glow" : "glows");
+ if (!quiet)
+ {
+ mprf("%s %s red for a moment.", iname.c_str(),
+ item.quantity > 1 ? "glow" : "glows");
+ }
item.plus++;
}
@@ -3951,7 +3954,7 @@ bool enchant_armour( int &ac_change, bool quiet, item_def &arm )
return (true);
}
- // even if not affected, it may be uncursed.
+ // Even if not affected, it may be uncursed.
if (!is_enchantable_armour(arm, false)
|| arm.plus >= 3 && random2(8) < arm.plus)
{
@@ -4358,7 +4361,7 @@ void read_scroll( int slot )
break;
case SCR_ENCHANT_WEAPON_III:
- if (you.equip[ EQ_WEAPON ] != -1)
+ if (you.equip[ EQ_WEAPON ] != -1)
{
// Successfully affixing the enchantment will print
// its own message.