diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/monster_blow.hpp | 8 | ||||
-rw-r--r-- | src/monster_ego.hpp | 9 | ||||
-rw-r--r-- | src/monster_race.hpp | 10 | ||||
-rw-r--r-- | src/monster_type.hpp | 8 |
4 files changed, 12 insertions, 23 deletions
diff --git a/src/monster_blow.hpp b/src/monster_blow.hpp index 0f19f64c..6e0ee6e5 100644 --- a/src/monster_blow.hpp +++ b/src/monster_blow.hpp @@ -12,8 +12,8 @@ */ struct monster_blow { - byte method; - byte effect; - byte d_dice; - byte d_side; + byte method = 0; + byte effect = 0; + byte d_dice = 0; + byte d_side = 0; }; diff --git a/src/monster_ego.hpp b/src/monster_ego.hpp index 873c642f..1154c537 100644 --- a/src/monster_ego.hpp +++ b/src/monster_ego.hpp @@ -3,6 +3,8 @@ #include "h-basic.h" #include "monster_blow.hpp" +#include <array> + /** * Monster ego descriptors. */ @@ -11,12 +13,7 @@ struct monster_ego const char *name = nullptr; /* Name */ bool_ before = false; /* Display ego before or after */ - monster_blow blow[4] = { /* Up to four blows per round */ - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - }; + std::array<monster_blow, 4> blow { }; /* Up to four blows per round */ byte blowm[4][2] = { { 0, 0 }, { 0, 0 }, diff --git a/src/monster_race.hpp b/src/monster_race.hpp index 1cb2742a..9fa9f590 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -5,6 +5,8 @@ #include "monster_blow.hpp" #include "obj_theme.hpp" +#include <array> + /** * Monster race descriptors and runtime data, including racial memories. * @@ -55,13 +57,7 @@ struct monster_race u32b flags8 = 0; /* Flags 8 (wilderness info) */ u32b flags9 = 0; /* Flags 9 (drops info) */ - - monster_blow blow[4] = { /* Up to four blows per round */ - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - }; + std::array<monster_blow, 4> blow { }; /* Up to four blows per round */ byte body_parts[BODY_MAX] = { 0 }; /* To help to decide what to use when body changing */ diff --git a/src/monster_type.hpp b/src/monster_type.hpp index 8353f228..ed6d3d2a 100644 --- a/src/monster_type.hpp +++ b/src/monster_type.hpp @@ -4,6 +4,7 @@ #include "monster_blow.hpp" #include "monster_race_fwd.hpp" +#include <array> #include <cassert> #include <vector> #include <memory> @@ -28,12 +29,7 @@ struct monster_type s32b hp = 0; /* Current Hit points */ s32b maxhp = 0; /* Max Hit points */ - monster_blow blow[4] = { /* Up to four blows per round */ - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - }; + std::array<monster_blow, 4> blow {};/* Up to four blows per round */ byte speed = 0; /* Speed (normally 110) */ byte level = 0; /* Level of creature */ |