summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-06-23 00:18:18 +0200
committerBardur Arantsson <bardur@scientician.net>2016-06-23 00:53:05 +0200
commitace1dc4db2d1025f1973b05bdd859e7577dc2835 (patch)
tree3d0c359ab9e871380b9e4526b912c532214331e4
parentb31e77642582a730b11ca80f495172a774fa6783 (diff)
Change wilderness_type_info to a non-POD type
-rw-r--r--src/init2.cc2
-rw-r--r--src/wilderness_type_info.hpp21
2 files changed, 11 insertions, 12 deletions
diff --git a/src/init2.cc b/src/init2.cc
index 93982bcc..1a8ca839 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -503,7 +503,7 @@ namespace {
static void allocate()
{
- wf_info = make_array<wilderness_type_info>(max_wf_idx);
+ wf_info = new wilderness_type_info[max_wf_idx];
}
static errr parse(FILE *fp)
diff --git a/src/wilderness_type_info.hpp b/src/wilderness_type_info.hpp
index bc23c03e..fa834e09 100644
--- a/src/wilderness_type_info.hpp
+++ b/src/wilderness_type_info.hpp
@@ -9,17 +9,16 @@
*/
struct wilderness_type_info
{
- const char *name; /* Name */
- const char *text; /* Text */
+ const char *name = nullptr; /* Name */
+ const char *text = nullptr; /* Text */
- u16b entrance; /* Which town is there(<1000 i's a town, >=1000 it a dungeon) */
- s32b wild_x; /* Map coordinates (backed out while parsing map) */
- s32b wild_y;
- byte road; /* Flags of road */
- int level; /* Difficulty level */
- u32b flags1; /* Some flags */
- byte feat; /* The feature of f_info.txt that is used to allow passing, ... and to get a char/color/graph */
- byte terrain_idx; /* Terrain index(defined in defines.h) */
+ u16b entrance = 0; /* Which town is there(<1000 i's a town, >=1000 it a dungeon) */
+ s32b wild_x = 0; /* Map coordinates (backed out while parsing map) */
+ s32b wild_y = 0;
+ byte road = 0; /* Flags of road */
+ int level = 0; /* Difficulty level */
+ byte feat = 0; /* The feature of f_info.txt that is used to allow passing, ... and to get a char/color/graph */
+ byte terrain_idx = 0; /* Terrain index(defined in defines.h) */
- byte terrain[MAX_WILD_TERRAIN];/* Feature types for the plasma generator */
+ byte terrain[MAX_WILD_TERRAIN] = { 0 }; /* Feature types for the plasma generator */
};