From 2b77a49fb98420b4ba7c36a7f2f5a0df2a2b64b8 Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 16 Apr 2008 23:44:59 +0000 Subject: Make sure that when TSO makes your wielded weapon an artefact, any stat drains it gets don't kill you. This is somewhat of a hack, but there doesn't seem to be a better way right now. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4278 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/item_use.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 ce4071cfca..af1c6906c5 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2771,8 +2771,9 @@ static int prompt_ring_to_remove(int new_ring) // Checks whether a to-be-worn or to-be-removed item affects // character stats and whether wearing/removing it could be fatal. -// If so, warns the player. -bool safe_to_remove_or_wear(const item_def &item, bool remove) +// If so, warns the player, or just returns false if quiet is true. +bool safe_to_remove_or_wear(const item_def &item, bool remove, + bool quiet) { int prop_str = 0; int prop_dex = 0; @@ -2818,7 +2819,7 @@ bool safe_to_remove_or_wear(const item_def &item, bool remove) if ((prop_str >= you.strength || prop_int >= you.intel || prop_dex >= you.dex) - && !yesno(prompt.c_str(), false, 'n')) + && (quiet || !yesno(prompt.c_str(), false, 'n'))) { return (false); } @@ -2833,7 +2834,7 @@ bool safe_to_remove_or_wear(const item_def &item, bool remove) if ((-prop_str >= you.strength || -prop_int >= you.intel || -prop_dex >= you.dex) - && !yesno(prompt.c_str(), false, 'n')) + && (quiet || !yesno(prompt.c_str(), false, 'n'))) { return (false); } -- cgit v1.2.3-54-g00ecf