diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-14 16:14:41 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-14 16:14:41 +0000 |
commit | e0b40c1af2042d933632a3534fea29f8c1243abb (patch) | |
tree | 9c330b80057b42ff169a97e334a6a7dc2766cd28 /crawl-ref/source/describe.cc | |
parent | d0fa191c0aefba806831fd1bc30f85f904b90b42 (diff) | |
download | crawl-ref-e0b40c1af2042d933632a3534fea29f8c1243abb.tar.gz crawl-ref-e0b40c1af2042d933632a3534fea29f8c1243abb.zip |
Fix 2018066: Crash when "autoinscribing" non-artefacts.
Fix 2017743: Game hanging for "good random choices" for Thieves/Wanderers
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6543 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r-- | crawl-ref/source/describe.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 9a130252d5..9799d95d9f 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2095,18 +2095,22 @@ void inscribe_item(item_def &item, bool proper_prompt) int keyin = tolower(c_getch()); switch (keyin) { - case 'a': - // Remove previous randart inscription - _trim_randart_inscrip(item); - - if (!item.inscription.empty()) - item.inscription += ", "; - - item.inscription += ainscrip; - break; case 'c': item.inscription.clear(); break; + case 'a': + if (need_autoinscribe) + { + // Remove previous randart inscription. + _trim_randart_inscrip(item); + + if (!item.inscription.empty()) + item.inscription += ", "; + + item.inscription += ainscrip; + break; + } + // If autoinscription is impossible, prompt for an inscription instead. case 'y': { prompt = (is_inscribed ? "Add what to inscription? " |