summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/acquire.cc
diff options
context:
space:
mode:
authorreaverb <reaverb.Crawl@gmail.com>2014-06-05 15:41:34 -0400
committerreaverb <reaverb.Crawl@gmail.com>2014-06-05 16:11:49 -0400
commit3202427a38d01ee2000ac7f99bc534ecfa44fa79 (patch)
treedc551606c0c2cd2e147477545fbec16b402158db /crawl-ref/source/acquire.cc
parent7971631360d9f8888148b8adf2cb965893ea6c2b (diff)
downloadcrawl-ref-3202427a38d01ee2000ac7f99bc534ecfa44fa79.tar.gz
crawl-ref-3202427a38d01ee2000ac7f99bc534ecfa44fa79.zip
Don't purposely avoid acquiring things the player is carrying
So for example, if you had a lamp of fire in your inventory and acquired misc, this code meant acquirement would purposely avoid giving you another lamp of fire. If it was in your stash, however, acquirement didn't care. This is obviously wrong since things like miscellaneous acquirement assume you can get multiple of a single sub_type, and violates the "don't make players do silly things before reading ?acquire" rule. This might alter the standings of staff, misc, and jewellry acquirement, but none of those are all stars likely to be totally broken by this change. I've traced this back to 1d0f57cbceb, with only a couple changes in between, so this either traces to before stone soup or shortly after.
Diffstat (limited to 'crawl-ref/source/acquire.cc')
-rw-r--r--crawl-ref/source/acquire.cc29
1 files changed, 3 insertions, 26 deletions
diff --git a/crawl-ref/source/acquire.cc b/crawl-ref/source/acquire.cc
index 8dd4993a7b..b4f31748e3 100644
--- a/crawl-ref/source/acquire.cc
+++ b/crawl-ref/source/acquire.cc
@@ -597,7 +597,7 @@ static bool _want_rod()
&& !one_chance_in(5);
}
-static int _acquirement_staff_subtype(const has_vector& already_has)
+static int _acquirement_staff_subtype()
{
// Try to pick an enhancer staff matching the player's best skill.
skill_type best_spell_skill = best_skill(SK_SPELLCASTING, SK_EVOCATIONS);
@@ -747,22 +747,6 @@ static int _find_acquirement_subtype(object_class_type &class_wanted,
int type_wanted = OBJ_RANDOM;
- // Write down what the player is carrying.
- has_vector already_has;
- already_has.init(0);
- for (int i = 0; i < ENDOFPACK; ++i)
- {
- const item_def& item = you.inv[i];
- if (item.defined() && item.base_type == class_wanted)
- {
- ASSERT(item.sub_type < max_has_value);
- already_has[item.sub_type] += item.quantity;
- }
- }
-
- bool try_again = (class_wanted == OBJ_JEWELLERY
- || class_wanted == OBJ_STAVES
- || class_wanted == OBJ_MISCELLANY);
int useless_count = 0;
while (1)
@@ -788,7 +772,7 @@ static int _find_acquirement_subtype(object_class_type &class_wanted,
case OBJ_ARMOUR: type_wanted = _acquirement_armour_subtype(divine); break;
case OBJ_MISCELLANY: type_wanted = _acquirement_misc_subtype(); break;
case OBJ_WANDS: type_wanted = _acquirement_wand_subtype(); break;
- case OBJ_STAVES: type_wanted = _acquirement_staff_subtype(already_has);
+ case OBJ_STAVES: type_wanted = _acquirement_staff_subtype();
break;
#if TAG_MAJOR_VERSION == 34
case OBJ_RODS:
@@ -815,14 +799,7 @@ static int _find_acquirement_subtype(object_class_type &class_wanted,
{
continue;
}
-
- if (!try_again)
- break;
-
- ASSERT(type_wanted < max_has_value);
- if (!already_has[type_wanted])
- break;
- if (one_chance_in(200))
+ else
break;
}