Skip to content

Commit

Permalink
Add deprecated warnings for [advance]
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Aug 23, 2015
1 parent f0c051d commit ad62e1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/scripting/game_lua_kernel.cpp
Expand Up @@ -3278,6 +3278,7 @@ static int intf_add_modification(lua_State *L)
std::string sm = m;
if (sm == "advance") { // Maintain backwards compatibility
sm = "advancement";
lg::wml_error << "(Lua) Modifications of type \"advance\" are deprecated, use \"advancement\" instead\n";
}
if (sm != "advancement" && sm != "object" && sm != "trait") {
return luaL_argerror(L, 2, "unknown modification type");
Expand Down
3 changes: 3 additions & 0 deletions src/unit.cpp
Expand Up @@ -2069,6 +2069,9 @@ void unit::apply_modifications()

for(size_t i = 0; i != NumModificationTypes; ++i) {
const std::string& mod = ModificationTypes[i];
if(mod == "advance" && modifications_.has_child(mod)) {
lg::wml_error << "[modifications][advance] is deprecated, use [advancement] instead\n";
}
BOOST_FOREACH(const config &m, modifications_.child_range(mod)) {
log_scope("add mod");
add_modification(ModificationTypes[i], m, true);
Expand Down

0 comments on commit ad62e1d

Please sign in to comment.