summaryrefslogtreecommitdiff
path: root/src/init2.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-06-23 00:52:48 +0200
committerBardur Arantsson <bardur@scientician.net>2016-06-23 00:53:05 +0200
commitb31e77642582a730b11ca80f495172a774fa6783 (patch)
tree8f2a81b44e0ef7f2c3679abc21122df488350bce /src/init2.cc
parent2190e84bd31c6cb0078df0fd674177989880afee (diff)
Change town_type to non-POD type
Diffstat (limited to 'src/init2.cc')
-rw-r--r--src/init2.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/init2.cc b/src/init2.cc
index eefed7ca..93982bcc 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -678,14 +678,9 @@ static errr init_misc(void)
*/
static errr init_towns(void)
{
- int i = 0, j = 0;
+ town_info = new town_type[max_towns];
- /*** Prepare the Towns ***/
-
- /* Allocate the towns */
- town_info = make_array<town_type>(max_towns);
-
- for (i = 1; i < max_towns; i++)
+ for (std::size_t i = 1; i < max_towns; i++)
{
if (i <= max_real_towns) town_info[i].flags |= (TOWN_REAL);
@@ -693,7 +688,7 @@ static errr init_towns(void)
town_info[i].store = new store_type[max_st_idx];
/* Fill in each store */
- for (j = 0; j < max_st_idx; j++)
+ for (std::size_t j = 0; j < max_st_idx; j++)
{
/* Access the store */
store_type *st_ptr = &town_info[i].store[j];
@@ -705,6 +700,7 @@ static errr init_towns(void)
st_ptr->stock_size = 0;
}
}
+
return 0;
}