Skip to content

Commit 241dbe3

Browse files
committed
Fix/tweak the jewellery_prompt option (rypofalem)
It was still skipping the prompt when the player tried to put on a ring while their ring slots were full of identical rings. It should now prompt here, as expected. However, some of the original behavior of this option is difficult to preserve. There *isn't* any concept of 'different ring slots' anymore to force the player to choose from when multiple are empty. So, I have edited the option description to no longer say that it does anything in this case.
1 parent 43dcba8 commit 241dbe3

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

crawl-ref/docs/options_guide.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,11 +1163,10 @@ equip_unequip = true
11631163
respectively) will unequip that item.
11641164

11651165
jewellery_prompt = false
1166-
If this is true, equipping rings will always prompt for the slot to
1167-
use, instead of automatically equipping the ring if there is an
1168-
available empty slot. Unequipping jewellery will also always prompt for
1169-
an item to remove, instead of skipping the prompt if only one item
1170-
of jewellery is equipped.
1166+
If this is true, unequipping jewellery will always prompt for an item
1167+
to remove, instead of skipping the prompt if only one item of jewellery
1168+
is equipped. Also, if all slots are filled when equipping a jewellery
1169+
item, it will prompt for which you remove even if they are all identical.
11711170

11721171
easy_confirm = (none | safe | all)
11731172
Make confirmation questions easier to answer:

crawl-ref/source/item-use.cc

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,11 +1144,16 @@ static item_def* _item_swap_prompt(const vector<item_def*>& candidates)
11441144
// If our list contains only identical items, return the first without a
11451145
// prompt.
11461146
bool found_non_match = false;
1147-
for (size_t i = 0; i < candidates.size() - 1; ++i)
1147+
for (size_t i = 0; i < candidates.size(); ++i)
11481148
{
11491149
item_def* item = candidates[i];
1150+
1151+
// If this option is true, all jewellery is considered 'non-matching'
11501152
if (item->base_type == OBJ_JEWELLERY && Options.jewellery_prompt)
1151-
continue;
1153+
{
1154+
found_non_match = true;
1155+
break;
1156+
}
11521157

11531158
for (size_t j = i + 1; j < candidates.size(); ++j)
11541159
{
@@ -1389,19 +1394,7 @@ bool try_equip_item(item_def& item)
13891394
}
13901395

13911396
if (candidates.size() == 1)
1392-
{
1393-
if (item.base_type == OBJ_JEWELLERY && Options.jewellery_prompt)
1394-
{
1395-
item_def* ret = _item_swap_prompt(candidates);
1396-
1397-
if (ret)
1398-
to_remove.push_back(ret);
1399-
else
1400-
return false;
1401-
}
1402-
else
1403-
to_remove.push_back(candidates[0]);
1404-
}
1397+
to_remove.push_back(candidates[0]);
14051398
else
14061399
{
14071400
// Save which item was selected to remove.

0 commit comments

Comments
 (0)