summaryrefslogtreecommitdiff
path: root/src/init2.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-10-05 18:45:08 +0200
committerBardur Arantsson <bardur@scientician.net>2016-10-05 18:45:08 +0200
commit1726fc7a8ab66c15385bdda8f0533cddeb867b58 (patch)
tree8552504fee7c59f2eb5ec0e77b2d31548067cb31 /src/init2.cc
parent5928204e69432be76b618bfa08c03e9bee6b3b09 (diff)
Move set_info into GameEditData
Diffstat (limited to 'src/init2.cc')
-rw-r--r--src/init2.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/init2.cc b/src/init2.cc
index f664ba40..6ae3d9ba 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -309,7 +309,7 @@ namespace {
static void allocate()
{
- set_info = new set_type[max_set_idx];
+ // Nothing to do
}
static errr parse(FILE *fp)
@@ -989,15 +989,20 @@ static errr init_alloc(void)
/* Init the sets in a_info */
static void init_sets_aux()
{
- int i, j;
+ auto const &set_info = game->edit_data.set_info;
- for (i = 0; i < max_a_idx; i++)
+ for (std::size_t i = 0; i < max_a_idx; i++)
+ {
a_info[i].set = -1;
- for (i = 0; i < max_set_idx; i++)
+ }
+
+ for (std::size_t i = 0; i < set_info.size(); i++)
{
- for (j = 0; j < set_info[i].num; j++)
+ auto const &set_ref = set_info[i];
+
+ for (std::size_t j = 0; j < set_ref.num; j++)
{
- a_info[set_info[i].arts[j].a_idx].set = i;
+ a_info[set_ref.arts[j].a_idx].set = i;
}
}
}