Make sure all members are initialized in the constructor.
This commit is contained in:
parent
67687630ab
commit
e750830c0c
1 changed files with 6 additions and 1 deletions
|
@ -295,7 +295,12 @@ namespace dfool {
|
|||
return(um.end());
|
||||
}
|
||||
|
||||
unit_memory::unit_memory(const game_data& gamedata, const config& cfg){
|
||||
unit_memory::unit_memory(const game_data& gamedata, const config& cfg) :
|
||||
units_(),
|
||||
ids_(),
|
||||
turns_(),
|
||||
locations_()
|
||||
{
|
||||
const config::child_list mem_list=cfg.get_children("unit_memory");
|
||||
for(config::child_list::const_iterator mem = mem_list.begin(); mem != mem_list.end(); ++mem) {
|
||||
config unit_cfg = *((*mem)->child("unit"));
|
||||
|
|
Loading…
Add table
Reference in a new issue