Skip to content

Commit

Permalink
fixup play_controller initialization order
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 10, 2014
1 parent b39601d commit 13fca9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/play_controller.cpp
Expand Up @@ -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_(),
Expand All @@ -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)),
Expand Down
6 changes: 5 additions & 1 deletion src/play_controller.hpp
Expand Up @@ -223,6 +223,11 @@ class play_controller : public controller_base, public events::observer, public
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_;
Expand All @@ -236,7 +241,6 @@ class play_controller : public controller_base, public events::observer, public
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).
Expand Down

0 comments on commit 13fca9a

Please sign in to comment.