Skip to content

Commit

Permalink
remove "random_mode_" from game_data
Browse files Browse the repository at this point in the history
we already have this information in the classification.
  • Loading branch information
gfgtdf committed May 31, 2014
1 parent 7ebbac3 commit b138912
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
11 changes: 0 additions & 11 deletions src/gamestatus.cpp
Expand Up @@ -193,7 +193,6 @@ carryover_info::carryover_info(const config& cfg)
, variables_(cfg.child_or_empty("variables"))
, rng_(cfg)
, wml_menu_items_()
, random_mode_(cfg["random_mode"].str())
, next_scenario_(cfg["next_scenario"])
{
end_level_.read(cfg.child_or_empty("end_level_data"));
Expand Down Expand Up @@ -261,7 +260,6 @@ void carryover_info::transfer_from(game_data& gamedata){
variables_ = gamedata.get_variables();
wml_menu_items_ = gamedata.get_wml_menu_items();
rng_ = gamedata.rng();
random_mode_ = gamedata.random_mode();
next_scenario_ = gamedata.next_scenario();
}

Expand All @@ -281,9 +279,6 @@ void carryover_info::transfer_to(config& level){
wml_menu_items_.to_config(level);
}

if(level["random_mode"].empty()){
level["random_mode"] = random_mode_;
}
next_scenario_ = "";

}
Expand All @@ -292,7 +287,6 @@ const config carryover_info::to_config()
{
config cfg;

cfg["random_mode"] = random_mode_;
cfg["next_scenario"] = next_scenario_;

BOOST_FOREACH(carryover& c, carryover_sides_){
Expand Down Expand Up @@ -617,7 +611,6 @@ game_data::game_data()
, temporaries_()
, phase_(INITIAL)
, can_end_turn_(true)
, random_mode_("")
, scenario_()
, next_scenario_()
{}
Expand All @@ -631,7 +624,6 @@ game_data::game_data(const config& level)
, temporaries_()
, phase_(INITIAL)
, can_end_turn_(level["can_end_turn"].to_bool(true))
, random_mode_(level["random_mode"].str())
, scenario_(level["id"])
, next_scenario_(level["next_scenario"])
{
Expand All @@ -648,7 +640,6 @@ game_data::game_data(const game_data& data)
, temporaries_()
, phase_(data.phase_)
, can_end_turn_(data.can_end_turn_)
, random_mode_(data.random_mode_)
, scenario_(data.scenario_)
, next_scenario_(data.next_scenario_)
{}
Expand Down Expand Up @@ -713,7 +704,6 @@ void game_data::clear_variable(const std::string& varname)
}

void game_data::write_snapshot(config& cfg){
cfg["random_mode"] = random_mode_;
cfg["scenario"] = scenario_;
cfg["next_scenario"] = next_scenario_;

Expand All @@ -728,7 +718,6 @@ void game_data::write_snapshot(config& cfg){
}

void game_data::write_config(config_writer& out){
out.write_key_val("random_mode", random_mode_);
out.write_key_val("scenario", scenario_);
out.write_key_val("next_scenario", next_scenario_);

Expand Down
5 changes: 0 additions & 5 deletions src/gamestatus.hpp
Expand Up @@ -101,7 +101,6 @@ class carryover_info{
, variables_()
, rng_()
, wml_menu_items_()
, random_mode_("")
, next_scenario_()
{}
// Turns config from a loaded savegame into carryover_info
Expand Down Expand Up @@ -130,7 +129,6 @@ class carryover_info{

const end_level_data& get_end_level() const;

const std::string& random_mode() const { return random_mode_; }
const std::string& next_scenario() const { return next_scenario_; }

const config to_config();
Expand All @@ -140,7 +138,6 @@ class carryover_info{
config variables_;
rand_rng::simple_rng rng_;
game_events::wmi_container wml_menu_items_;
std::string random_mode_; /**< whether we generate a new randomseed for each user action. */
std::string next_scenario_; /**< the scenario coming next (for campaigns) */
};

Expand Down Expand Up @@ -200,7 +197,6 @@ class game_data : public variable_set {
void write_snapshot(config& cfg);
void write_config(config_writer& out);

const std::string& random_mode() const { return random_mode_; }
const std::string& next_scenario() const { return next_scenario_; }
void set_next_scenario(const std::string& next_scenario) { next_scenario_ = next_scenario; }

Expand All @@ -215,7 +211,6 @@ class game_data : public variable_set {
friend struct variable_info;
PHASE phase_;
bool can_end_turn_;
std::string random_mode_;
std::string scenario_; /**< the scenario being played */
std::string next_scenario_; /**< the scenario coming next (for campaigns) */
};
Expand Down
2 changes: 1 addition & 1 deletion src/play_controller.cpp
Expand Up @@ -585,7 +585,7 @@ void play_controller::fire_start(bool execute){
} else {
it_is_a_new_turn_ = false;
}
if((gamedata_.random_mode() != "" || gamestate_.classification().random_mode != "") && (network::nconnections() != 0))
if( gamestate_.classification().random_mode != "" && (network::nconnections() != 0))
{
std::string mes = _("MP game uses an alternative random mode, if you don't know what this message means, then most likeley someone is cheating or someone reloaded a corrupt game.");
resources::screen->add_chat_message(
Expand Down

0 comments on commit b138912

Please sign in to comment.