Revert "replace play_controller::loading_game_ member"
This reverts commit 46786c9fa3
.
The other implementation did not work becasue game_data phase was reset to PRELOAD in fire_preload()
Conflicts:
src/play_controller.cpp
src/playsingle_controller.cpp
src/replay_controller.cpp
This commit is contained in:
parent
040a69bdd9
commit
33bf5c60b8
4 changed files with 8 additions and 7 deletions
|
@ -54,9 +54,6 @@ game_data::game_data(const config& level)
|
|||
, can_end_turn_(level["can_end_turn"].to_bool(true))
|
||||
, next_scenario_(level["next_scenario"])
|
||||
{
|
||||
if(!level["playing_team"].empty()) {
|
||||
phase_ = INITIAL_RELOAD;
|
||||
}
|
||||
}
|
||||
|
||||
game_data::game_data(const game_data& data)
|
||||
|
|
|
@ -68,7 +68,6 @@ public:
|
|||
rand_rng::mt_rng& rng() { return rng_; }
|
||||
|
||||
enum PHASE {
|
||||
INITIAL_RELOAD,
|
||||
INITIAL,
|
||||
PRELOAD,
|
||||
PRESTART,
|
||||
|
@ -78,7 +77,7 @@ public:
|
|||
|
||||
PHASE phase() const { return phase_; }
|
||||
void set_phase(PHASE phase) { phase_ = phase; }
|
||||
bool is_reloading() const { return phase_ == INITIAL_RELOAD; }
|
||||
|
||||
bool allow_end_turn() const { return can_end_turn_; }
|
||||
void set_allow_end_turn(bool value) { can_end_turn_ = value; }
|
||||
|
||||
|
|
|
@ -134,6 +134,7 @@ play_controller::play_controller(const config& level, saved_game& state_of_game,
|
|||
, statistics_context_(new statistics::scenario_context(level["name"]))
|
||||
, undo_stack_(new actions::undo_list(level.child("undo_stack")))
|
||||
, replay_(new replay(state_of_game.get_replay()))
|
||||
, loading_game_(!level["playing_team"].empty())
|
||||
, player_number_(level["playing_team"].to_int() + 1)
|
||||
, start_turn_(gamestate_.tod_manager_.turn()) // gamestate_.tod_manager_ constructed above
|
||||
, skip_replay_(skip_replay)
|
||||
|
@ -325,7 +326,8 @@ void play_controller::fire_start()
|
|||
gamestate_.gamedata_.set_phase(game_data::PLAY);
|
||||
}
|
||||
|
||||
void play_controller::init_gui(){
|
||||
void play_controller::init_gui()
|
||||
{
|
||||
gui_->begin_game();
|
||||
gui_->update_tod();
|
||||
}
|
||||
|
@ -1008,7 +1010,7 @@ void play_controller::start_game()
|
|||
{
|
||||
fire_preload();
|
||||
|
||||
if(!resources::gamedata->is_reloading())
|
||||
if(!loading_game_)
|
||||
{
|
||||
resources::recorder->add_start_if_not_there_yet();
|
||||
resources::recorder->get_next_action();
|
||||
|
|
|
@ -272,6 +272,9 @@ protected:
|
|||
boost::scoped_ptr<actions::undo_list> undo_stack_;
|
||||
boost::scoped_ptr<replay> replay_;
|
||||
|
||||
/// if a team is specified whose turn it is, it means we're loading a game instead of starting a fresh one.
|
||||
bool loading_game_;
|
||||
|
||||
int player_number_;
|
||||
unsigned int start_turn_;
|
||||
bool skip_replay_;
|
||||
|
|
Loading…
Add table
Reference in a new issue