diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-06-20 22:49:05 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-06-20 22:49:05 +0200 |
commit | 9c26f78ce556d3a0717e4bc5668a1ed59217f414 (patch) | |
tree | 4dabc3014c60d469b694022d40405baa8910d843 /src/player_race_mod.hpp | |
parent | 287df870759d0fc854f76d34151a597b9f529b43 (diff) |
Change player_{race, spec, class} to non-POD types
Diffstat (limited to 'src/player_race_mod.hpp')
-rw-r--r-- | src/player_race_mod.hpp | 95 |
1 files changed, 47 insertions, 48 deletions
diff --git a/src/player_race_mod.hpp b/src/player_race_mod.hpp index 9f21b253..23be55d7 100644 --- a/src/player_race_mod.hpp +++ b/src/player_race_mod.hpp @@ -3,73 +3,72 @@ #include "body.hpp" #include "h-basic.h" #include "player_defs.hpp" +#include "player_race_ability_type.hpp" #include "skills_defs.hpp" +#include <array> + struct player_race_mod { - char *title; /* Type of race mod */ - char *desc; /* Desc */ + char *title = nullptr; /* Type of race mod */ + char *desc = nullptr; /* Desc */ - bool_ place; /* TRUE = race race modifier, FALSE = Race modifier race */ + bool_ place = FALSE; /* TRUE = race race modifier, FALSE = Race modifier race */ - s16b r_adj[6]; /* (+) Racial stat bonuses */ + s16b r_adj[6] { }; /* (+) Racial stat bonuses */ - char luck; /* Luck */ - s16b mana; /* Mana % */ + char luck = '\0'; /* Luck */ + s16b mana = 0; /* Mana % */ - s16b r_dis; /* (+) disarming */ - s16b r_dev; /* (+) magic devices */ - s16b r_sav; /* (+) saving throw */ - s16b r_stl; /* (+) stealth */ - s16b r_srh; /* (+) search ability */ - s16b r_fos; /* (+) search frequency */ - s16b r_thn; /* (+) combat (normal) */ - s16b r_thb; /* (+) combat (shooting) */ + s16b r_dis = 0; /* (+) disarming */ + s16b r_dev = 0; /* (+) magic devices */ + s16b r_sav = 0; /* (+) saving throw */ + s16b r_stl = 0; /* (+) stealth */ + s16b r_srh = 0; /* (+) search ability */ + s16b r_fos = 0; /* (+) search frequency */ + s16b r_thn = 0; /* (+) combat (normal) */ + s16b r_thb = 0; /* (+) combat (shooting) */ - char r_mhp; /* (+) Race mod hit-dice modifier */ - s16b r_exp; /* (+) Race mod experience factor */ + char r_mhp = 0; /* (+) Race mod hit-dice modifier */ + s16b r_exp = 0; /* (+) Race mod experience factor */ - char infra; /* (+) Infra-vision range */ + char infra = '\0'; /* (+) Infra-vision range */ - u32b choice[2]; /* Legal race choices */ + u32b choice[2] { }; /* Legal race choices */ - u32b pclass[2]; /* Classes allowed */ - u32b mclass[2]; /* Classes restricted */ + u32b pclass[2] { }; /* Classes allowed */ + u32b mclass[2] { }; /* Classes restricted */ - s16b powers[4]; /* Powers of the subrace */ + s16b powers[4] { }; /* Powers of the subrace */ - char body_parts[BODY_MAX]; /* To help to decide what to use when body changing */ + char body_parts[BODY_MAX] { }; /* To help to decide what to use when body changing */ - u32b flags1; - u32b flags2; /* flags */ + u32b flags1 = 0; + u32b flags2 = 0; - u32b oflags1[PY_MAX_LEVEL + 1]; - u32b oflags2[PY_MAX_LEVEL + 1]; - u32b oflags3[PY_MAX_LEVEL + 1]; - u32b oflags4[PY_MAX_LEVEL + 1]; - u32b oflags5[PY_MAX_LEVEL + 1]; - u32b oesp[PY_MAX_LEVEL + 1]; - s16b opval[PY_MAX_LEVEL + 1]; + u32b oflags1[PY_MAX_LEVEL + 1] { }; + u32b oflags2[PY_MAX_LEVEL + 1] { }; + u32b oflags3[PY_MAX_LEVEL + 1] { }; + u32b oflags4[PY_MAX_LEVEL + 1] { }; + u32b oflags5[PY_MAX_LEVEL + 1] { }; + u32b oesp[PY_MAX_LEVEL + 1] { }; + s16b opval[PY_MAX_LEVEL + 1] { }; - byte g_attr; /* Overlay graphic attribute */ - char g_char; /* Overlay graphic character */ + byte g_attr = 0; /* Overlay graphic attribute */ + char g_char = '\0'; /* Overlay graphic character */ - char skill_basem[MAX_SKILLS]; - u32b skill_base[MAX_SKILLS]; - char skill_modm[MAX_SKILLS]; - s16b skill_mod[MAX_SKILLS]; + char skill_basem[MAX_SKILLS] { }; + u32b skill_base[MAX_SKILLS] { }; + char skill_modm[MAX_SKILLS] { }; + s16b skill_mod[MAX_SKILLS] { }; - s16b obj_tval[5]; - s16b obj_sval[5]; - s16b obj_pval[5]; - s16b obj_dd[5]; - s16b obj_ds[5]; - s16b obj_num; + s16b obj_tval[5] { }; + s16b obj_sval[5] { }; + s16b obj_pval[5] { }; + s16b obj_dd[5] { }; + s16b obj_ds[5] { }; + s16b obj_num = 0; - struct - { - s16b ability; - s16b level; - } abilities[10]; /* Abilitiers to be gained by level(doesnt take prereqs in account) */ + std::array<player_race_ability_type, 10> abilities; /* Abilities to be gained by level; doesnt take prereqs in account */ }; |