summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-15 20:15:55 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-15 20:15:55 +0000
commit420044b3c16c778b37fde736c26a7e4863b69a48 (patch)
treeea2c8dd236064237dcc4780567449833c92e8333 /crawl-ref/source/describe.cc
parente5f0d4e5bdd06313cffa545cd5d8fe404e015b2e (diff)
downloadcrawl-ref-420044b3c16c778b37fde736c26a7e4863b69a48.tar.gz
crawl-ref-420044b3c16c778b37fde736c26a7e4863b69a48.zip
Fix bad potions not counting as useless and thus being auto-picked up.
Fix bad message when using 'W' with no armour and crash when attempting to enchant armour with no enchantable armour in inventory. Tweak '{' to only prompt if at least one of autoinscription or clearing an existing inscription apply. (FR 2017541) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6567 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc51
1 files changed, 31 insertions, 20 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 3d65db6941..9a7692f1e9 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2079,35 +2079,46 @@ void inscribe_item(item_def &item, bool proper_prompt)
}
}
- std::string prompt = (is_inscribed ? "Add to inscription? "
- : "Inscribe item? ");
+ std::string prompt;
+ int keyin;
+ bool did_prompt = false;
- if (need_autoinscribe || is_inscribed)
+ // Don't prompt for whether to inscribe in the first place if the
+ // player is using '{' - unless autoinscribing or clearing an
+ // existing inscription become an option.
+ if (!proper_prompt || need_autoinscribe || is_inscribed)
{
- prompt += "(You may also ";
- if (need_autoinscribe)
+ prompt = (is_inscribed ? "Add to inscription? "
+ : "Inscribe item? ");
+
+ if (need_autoinscribe || is_inscribed)
{
- prompt += "(a)utoinscribe";
+ prompt += "(You may also ";
+ if (need_autoinscribe)
+ {
+ prompt += "(a)utoinscribe";
+ if (is_inscribed)
+ prompt += ", or ";
+ }
if (is_inscribed)
- prompt += ", or ";
+ prompt += "(c)lear it";
+ prompt += ".) ";
}
- if (is_inscribed)
- prompt += "(c)lear it";
- prompt += ".) ";
- }
- if (proper_prompt)
- mpr(prompt.c_str(), MSGCH_PROMPT);
- else
- {
- prompt = "<cyan>" + prompt + "</cyan>";
- formatted_string::parse_string(prompt).display();
+ if (proper_prompt)
+ mpr(prompt.c_str(), MSGCH_PROMPT);
+ else
+ {
+ prompt = "<cyan>" + prompt + "</cyan>";
+ formatted_string::parse_string(prompt).display();
- if (Options.tutorial_left && wherey() <= get_number_of_lines() - 5)
- tutorial_inscription_info(need_autoinscribe, prompt);
+ if (Options.tutorial_left && wherey() <= get_number_of_lines() - 5)
+ tutorial_inscription_info(need_autoinscribe, prompt);
+ }
+ did_prompt = true;
}
- int keyin = tolower(c_getch());
+ keyin = (did_prompt ? tolower(c_getch()) : 'y');
switch (keyin)
{
case 'c':