Make sure all members are initialized in the constructor.
This commit is contained in:
parent
c4e33d0896
commit
be8d97a7f4
2 changed files with 28 additions and 4 deletions
|
@ -49,6 +49,8 @@ create::create(game_display& disp, const config &cfg, chat& c, config& gamelist)
|
|||
map_selection_(-1),
|
||||
mp_countdown_init_time_(270),
|
||||
mp_countdown_reservoir_time_(330),
|
||||
user_maps_(),
|
||||
map_options_(),
|
||||
|
||||
maps_menu_(disp.video(), std::vector<std::string>()),
|
||||
turns_slider_(disp.video()),
|
||||
|
@ -85,7 +87,8 @@ create::create(game_display& disp, const config &cfg, chat& c, config& gamelist)
|
|||
name_entry_(disp.video(), 32),
|
||||
minimap_restorer_(NULL),
|
||||
minimap_rect_(null_rect),
|
||||
generator_(NULL)
|
||||
generator_(NULL),
|
||||
parameters_()
|
||||
{
|
||||
// Build the list of scenarios to play
|
||||
|
||||
|
|
|
@ -32,7 +32,28 @@ class create : public mp::ui
|
|||
public:
|
||||
struct parameters
|
||||
{
|
||||
parameters() { reset(); };
|
||||
parameters() :
|
||||
name(),
|
||||
era(),
|
||||
num_turns(0),
|
||||
village_gold(0),
|
||||
xp_modifier(0),
|
||||
mp_countdown_init_time(0),
|
||||
mp_countdown_reservoir_time(0),
|
||||
mp_countdown_turn_bonus(0),
|
||||
mp_countdown_action_bonus(0),
|
||||
mp_countdown(false),
|
||||
use_map_settings(false),
|
||||
random_start_time(false),
|
||||
fog_game(false),
|
||||
shroud_game(false),
|
||||
allow_observers(false),
|
||||
share_view(false),
|
||||
share_maps(false),
|
||||
saved_game(false),
|
||||
scenario_data()
|
||||
|
||||
{ reset(); };
|
||||
|
||||
void reset() {
|
||||
name = "";
|
||||
|
@ -40,11 +61,11 @@ public:
|
|||
num_turns = 0;
|
||||
village_gold = 0;
|
||||
xp_modifier = 0;
|
||||
mp_countdown=false;
|
||||
mp_countdown_init_time=0;
|
||||
mp_countdown_turn_bonus=0;
|
||||
mp_countdown_reservoir_time=0;
|
||||
mp_countdown_turn_bonus=0;
|
||||
mp_countdown_action_bonus=0;
|
||||
mp_countdown=false;
|
||||
use_map_settings = random_start_time = fog_game = shroud_game = allow_observers = share_view = share_maps = false;
|
||||
|
||||
scenario_data.clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue