mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-07 11:12:04 +00:00
Deprecate [replace_map]map= in favour of [replace_map]map_data=
This gives greater consistency between similar APIs, and allows macros intended to drop a map into [scenario] to also work in [replace_map]. (cherry-picked from commit c62a4820fcab36e3c556f698d60e1afa9d242f84)
This commit is contained in:
parent
75a9a51166
commit
6a698064d6
@ -61,6 +61,7 @@
|
||||
#include "units/filter.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
#include "whiteboard/manager.hpp"
|
||||
#include "deprecation.hpp"
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
@ -600,11 +601,14 @@ WML_HANDLER_FUNCTION(replace_map,, cfg)
|
||||
if(!cfg["map_file"].empty()) {
|
||||
config file_cfg = mp_sync::get_user_choice("map_data", map_choice(cfg["map_file"].str()));
|
||||
map.read(file_cfg["map_data"].str(), false);
|
||||
} else if(!cfg["map_data"].empty()) {
|
||||
map.read(cfg["map_data"], false);
|
||||
} else {
|
||||
deprecated_message("[replace_map]map=", DEP_LEVEL::INDEFINITE, "1.16", "Use map_data= instead.");
|
||||
map.read(cfg["map"], false);
|
||||
}
|
||||
} catch(incorrect_map_format_error&) {
|
||||
const std::string log_map_name = cfg["map"].empty() ? cfg["file"] : std::string("from inline data");
|
||||
const std::string log_map_name = cfg["map"].empty() ? cfg["map_file"] : std::string("from inline data");
|
||||
lg::wml_error() << "replace_map: Unable to load map " << log_map_name << std::endl;
|
||||
return;
|
||||
} catch(wml_exception& e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user