summaryrefslogtreecommitdiff
path: root/src/store.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:13 +0200
committerBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:13 +0200
commit347afc50368137901a989ac4a4fc9298056c7377 (patch)
tree77079e0abd4027427f48ccf4e8d59629b6be3228 /src/store.cc
parent1229c2ce5a196b39e0c9602c8fb037b394b18833 (diff)
Unify store_info_type::item_* info std::vector<store_item>
Diffstat (limited to 'src/store.cc')
-rw-r--r--src/store.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/store.cc b/src/store.cc
index 63f9f0d1..68d3900e 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -1197,7 +1197,7 @@ static bool_ kind_is_storeok(int k_idx)
*/
static void store_create(void)
{
- int i = 0, tries, level = 0, chance, item;
+ int i = 0, tries, level = 0;
object_type forge;
object_type *q_ptr = NULL;
@@ -1281,9 +1281,9 @@ static void store_create(void)
else
{
/* Hack -- Pick an item to sell */
- item = rand_int(st_info[st_ptr->st_idx].item_num);
- i = st_info[st_ptr->st_idx].item_kind[item];
- chance = st_info[st_ptr->st_idx].item_chance[item];
+ auto const &item = st_info[st_ptr->st_idx].items[rand_int(st_info[st_ptr->st_idx].items.size())];
+ i = item.kind;
+ auto chance = item.chance;
/* Don't allow k_info artifacts */
if ((i <= 10000) && (k_info[i].flags & TR_NORM_ART))