fixup play_controller initialization order

This commit is contained in:
Chris Beck 2014-06-10 17:16:11 -04:00
parent b39601d700
commit 13fca9a358
2 changed files with 6 additions and 2 deletions

View File

@ -107,6 +107,7 @@ play_controller::play_controller(const config& level, game_state& state_of_game,
halo_manager_(),
labels_manager_(),
help_manager_(&game_config),
gameboard_(game_config, level),
mouse_handler_(NULL, gameboard_),
menu_handler_(NULL, gameboard_, level, game_config),
soundsources_manager_(),
@ -118,7 +119,6 @@ play_controller::play_controller(const config& level, game_state& state_of_game,
level_(level),
gamestate_(state_of_game),
gamedata_(level),
gameboard_(game_config, level),
undo_stack_(new actions::undo_list(level.child("undo_stack"))),
whiteboard_manager_(),
xp_mod_(level["experience_modifier"].to_int(100)),

View File

@ -223,6 +223,11 @@ protected:
boost::scoped_ptr<halo::manager> halo_manager_;
font::floating_label_context labels_manager_;
help::help_manager help_manager_;
//this must be before mouse_handler and menu_handler or we segfault
game_board gameboard_;
//more managers
events::mouse_handler mouse_handler_;
events::menu_handler menu_handler_;
boost::scoped_ptr<soundsource::manager> soundsources_manager_;
@ -236,7 +241,6 @@ protected:
const config& level_;
game_state& gamestate_;
game_data gamedata_;
game_board gameboard_;
/// undo_stack_ is never NULL. It is implemented as a pointer so that
/// undo_list can be an incomplete type at this point (which reduces the
/// number of files that depend on actions/undo.hpp).