From 2055942d4ba70adfd48f939b2a6d140f2329a2b6 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 23 Mar 2008 19:03:38 +0000 Subject: 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 --- crawl-ref/source/item_use.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 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 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. -- cgit v1.2.3-54-g00ecf