Skip to content

Commit

Permalink
Deprecate [replace_map]map= in favour of [replace_map]map_data=
Browse files Browse the repository at this point in the history
This gives greater consistency between similar APIs, and allows macros
intended to drop a map into [scenario] to also work in [replace_map].
  • Loading branch information
CelticMinstrel committed Mar 31, 2018
1 parent eb4184e commit 3af8a27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/game_events/action_wml.cpp
Expand Up @@ -61,6 +61,7 @@
#include "units/filter.hpp"
#include "wml_exception.hpp"
#include "whiteboard/manager.hpp"
#include "deprecation.hpp"

#include <boost/regex.hpp>

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3af8a27

Please sign in to comment.