Skip to content

Commit

Permalink
Add deprecation messages to aspects
Browse files Browse the repository at this point in the history
[target], [protect_unit], [protect_location],
protect_leader=, protect_leader_radius=.
Patch by pl_kolek. See https://gna.org/patch/?3884
  • Loading branch information
flixx committed Jun 11, 2013
1 parent db2f046 commit 8c91d2e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Version 1.11.4+dev:
using ~CROP() with negative coordinates.
* Fixed abilities sometimes affecting self during movement even when they are
flagged as not affecting self (bug #20755).
* Added deprecation messages to aspects [target], [protect_unit], [protect_location],
protect_leader=, protect_leader_radius=
* Miscellaneous and bug fixes
* Fixed minor issue with Drake Clasher animations
* Added a new playlist FULL_MUSIC_PLAYLIST, which contains all Wesnoth tracks
Expand Down
3 changes: 3 additions & 0 deletions data/core/about.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,9 @@
name = "Martin Bede"
comment = "2012 Google Code-in Students' Micro AI development"
[/entry]
[entry]
name = "Mateusz Kolaczek (PL_kolek)"
[/entry]
[entry]
name = "Matthias Schoeck (mattsc)"
comment = "AI improvements"
Expand Down
6 changes: 6 additions & 0 deletions src/ai/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "../serialization/parser.hpp"
#include "../serialization/preprocessor.hpp"
#include "../team.hpp"
#include "wml_exception.hpp"

#include <boost/foreach.hpp>

Expand Down Expand Up @@ -399,6 +400,7 @@ bool configuration::upgrade_side_config_from_1_07_02_to_1_07_03(side_number side


BOOST_FOREACH(const config &aitarget, aiparam.child_range("target")) {
lg::wml_error << deprecate_wml_key_warning("target", "1.12.0") << "\n";
config aigoal;
transfer_turns_and_time_of_day_data(aiparam,aigoal);

Expand All @@ -417,13 +419,15 @@ bool configuration::upgrade_side_config_from_1_07_02_to_1_07_03(side_number side


BOOST_FOREACH(config &ai_protect_unit, aiparam.child_range("protect_unit")) {
lg::wml_error << deprecate_wml_key_warning("protect_unit", "1.12.0") << "\n";
transfer_turns_and_time_of_day_data(aiparam,ai_protect_unit);
upgrade_protect_goal_config_from_1_07_02_to_1_07_03(side,ai_protect_unit,parsed_cfg,true);
}
aiparam.clear_children("protect_unit");


BOOST_FOREACH(config &ai_protect_location, aiparam.child_range("protect_location")) {
lg::wml_error << deprecate_wml_key_warning("protect_location", "1.12.0") << "\n";
transfer_turns_and_time_of_day_data(aiparam,ai_protect_location);
upgrade_protect_goal_config_from_1_07_02_to_1_07_03(side,ai_protect_location,parsed_cfg,false);
}
Expand All @@ -432,12 +436,14 @@ bool configuration::upgrade_side_config_from_1_07_02_to_1_07_03(side_number side

if (const config::attribute_value *v = aiparam.get("protect_leader"))
{
lg::wml_error << deprecate_wml_key_warning("protect_leader", "1.12.0") << "\n";
config c;
c["value"] = *v;
c["canrecruit"] = true;
c["side_number"] = side;
transfer_turns_and_time_of_day_data(aiparam,c);
if (const config::attribute_value *v = aiparam.get("protect_leader_radius")) {
lg::wml_error << deprecate_wml_key_warning("protect_leader_radius", "1.12.0") << "\n";
c["radius"] = *v;
}

Expand Down

0 comments on commit 8c91d2e

Please sign in to comment.