Rename [scenario] map= key to map_file for consistency with [replace_map]

This key was undocumented before so it shouldn't break anything
This commit is contained in:
Charles Dang 2015-10-07 04:11:09 +11:00
parent c1e8acd119
commit 3d06f689d7
3 changed files with 9 additions and 7 deletions

View File

@ -760,11 +760,11 @@ void save_preview_pane::draw_contents()
const config &scenario = game_config_->find_child(summary["campaign_type"], "id", summary["scenario"]);
if (scenario && !scenario.find_child("side", "shroud", "yes")) {
map_data = scenario["map_data"].str();
if (map_data.empty() && scenario.has_attribute("map")) {
if (map_data.empty() && scenario.has_attribute("map_file")) {
try {
map_data = filesystem::read_map(scenario["map"]);
map_data = filesystem::read_map(scenario["map_file"]);
} catch(filesystem::io_exception& e) {
ERR_G << "could not read map '" << scenario["map"] << "': " << e.what() << '\n';
ERR_G << "could not read map '" << scenario["map_file"] << "': " << e.what() << '\n';
}
}
}

View File

@ -602,7 +602,7 @@ void gamebrowser::populate_game_item_map_info(gamebrowser::game_item & item, con
item.map_data = game["map_data"].str();
if(item.map_data.empty()) {
item.map_data = filesystem::read_map(game["map"]);
item.map_data = filesystem::read_map(game["map_file"]);
}
if(! item.map_data.empty()) {
try {

View File

@ -364,10 +364,12 @@ void saved_game::expand_random_scenario()
update_label();
set_defaults();
}
//it looks like we support a map= where map=filename equals more or less map_data={filename}
if(starting_pos_["map_data"].empty() && !starting_pos_["map"].empty()) {
starting_pos_["map_data"] = filesystem::read_map(starting_pos_["map"]);
// If no map_data is provided, try to load the specified file directly
if(starting_pos_["map_data"].empty() && !starting_pos_["map_file"].empty()) {
starting_pos_["map_data"] = filesystem::read_map(starting_pos_["map_file"]);
}
// If the map should be randomly generated
// We dont want that we accidentally to this twice so we check for starting_pos_["map_data"].empty()
if(starting_pos_["map_data"].empty() && !starting_pos_["map_generation"].empty()) {