mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 09:32:01 +00:00
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:
parent
c1e8acd119
commit
3d06f689d7
@ -760,11 +760,11 @@ void save_preview_pane::draw_contents()
|
|||||||
const config &scenario = game_config_->find_child(summary["campaign_type"], "id", summary["scenario"]);
|
const config &scenario = game_config_->find_child(summary["campaign_type"], "id", summary["scenario"]);
|
||||||
if (scenario && !scenario.find_child("side", "shroud", "yes")) {
|
if (scenario && !scenario.find_child("side", "shroud", "yes")) {
|
||||||
map_data = scenario["map_data"].str();
|
map_data = scenario["map_data"].str();
|
||||||
if (map_data.empty() && scenario.has_attribute("map")) {
|
if (map_data.empty() && scenario.has_attribute("map_file")) {
|
||||||
try {
|
try {
|
||||||
map_data = filesystem::read_map(scenario["map"]);
|
map_data = filesystem::read_map(scenario["map_file"]);
|
||||||
} catch(filesystem::io_exception& e) {
|
} 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';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -602,7 +602,7 @@ void gamebrowser::populate_game_item_map_info(gamebrowser::game_item & item, con
|
|||||||
|
|
||||||
item.map_data = game["map_data"].str();
|
item.map_data = game["map_data"].str();
|
||||||
if(item.map_data.empty()) {
|
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()) {
|
if(! item.map_data.empty()) {
|
||||||
try {
|
try {
|
||||||
|
@ -364,10 +364,12 @@ void saved_game::expand_random_scenario()
|
|||||||
update_label();
|
update_label();
|
||||||
set_defaults();
|
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()) {
|
// If no map_data is provided, try to load the specified file directly
|
||||||
starting_pos_["map_data"] = filesystem::read_map(starting_pos_["map"]);
|
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
|
// If the map should be randomly generated
|
||||||
// We don’t want that we accidentally to this twice so we check for starting_pos_["map_data"].empty()
|
// We don’t 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()) {
|
if(starting_pos_["map_data"].empty() && !starting_pos_["map_generation"].empty()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user