summaryrefslogtreecommitdiff
path: root/src/init2.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
commita7ead32f2066fe12dd2154800f480247dc6d7c6c (patch)
tree2dd4a6371a8fd50e1be7bc3138da0e531e67738d /src/init2.cc
parent9ca81ed64c847db6b5d2a0890e7aea3ac96d92d1 (diff)
Use std::vector for town_type::store
Diffstat (limited to 'src/init2.cc')
-rw-r--r--src/init2.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/init2.cc b/src/init2.cc
index fca7473a..5a4662a0 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -682,15 +682,16 @@ static errr init_towns(void)
for (std::size_t i = 1; i < max_towns; i++)
{
- if (i <= max_real_towns) town_info[i].flags |= (TOWN_REAL);
-
- /* Allocate the stores */
- town_info[i].store = new store_type[max_st_idx];
+ if (i <= max_real_towns)
+ {
+ town_info[i].flags |= TOWN_REAL;
+ }
/* Fill in each store */
for (std::size_t j = 0; j < max_st_idx; j++)
{
- /* Access the store */
+ /* Create the store */
+ town_info[i].store.emplace_back(store_type());
store_type *st_ptr = &town_info[i].store[j];
/* Know who we are */