Merge branch 'master' of github.com:wesnoth/wesnoth

This commit is contained in:
Alexander van Gessel 2014-02-28 21:00:15 +01:00
commit d3efb49d82
5 changed files with 17 additions and 10 deletions

View file

@ -1,6 +1,11 @@
Version 1.11.10+dev:
* Add-ons server:
* Filenames with whitespace in them are no longer allowed.
* AI:
* Non-default multiplayer and Micro AIs:
* Fixed bugs which could lead to the AIs being disabled for the rest of the
turn if WML events removed or changed units during the AI turn
* Improved error reporting of invalid AI actions
* Campaigns:
* Eastern Invasion:
* Updated maps for scenario 8, 11, 12, 14, 16 and 17a.

View file

@ -559,7 +559,7 @@ return {
until recruit_type ~= nil
if wesnoth.unit_types[recruit_type].cost <= wesnoth.sides[wesnoth.current.side].gold then
ai.recruit(recruit_type, recruit_data.recruit.best_hex[1], recruit_data.recruit.best_hex[2])
AH.checked_recruit(ai, recruit_type, recruit_data.recruit.best_hex[1], recruit_data.recruit.best_hex[2])
-- If the recruited unit cannot reach the target hex, return it to the pool of targets
if recruit_data.recruit.target_hex ~= nil and recruit_data.recruit.target_hex[1] ~= nil then

View file

@ -254,7 +254,7 @@ return {
if AH.print_exec() then print_time(' Executing castle_switch CA') end
if AH.show_messages() then W.message { speaker = leader.id, message = 'Switching castles' } end
ai.move(leader, self.data.leader_target[1], self.data.leader_target[2])
AH.checked_move(ai, leader, self.data.leader_target[1], self.data.leader_target[2])
self.data.leader_target = nil
end
@ -493,12 +493,14 @@ return {
local defender = wesnoth.get_unit(self.data.attack.target.x, self.data.attack.target.y)
AH.movefull_stopunit(ai, attacker, self.data.attack.dst.x, self.data.attack.dst.y)
if (not attacker) or (not attacker.valid) then return end
if (not defender) or (not defender.valid) then return end
-- Find the poison weapon
-- If several attacks have poison, this will always find the last one
local is_poisoner, poison_weapon = AH.has_weapon_special(attacker, "poison")
ai.attack(attacker, defender, poison_weapon)
AH.checked_attack(ai, attacker, defender, poison_weapon)
self.data.attack = nil
end
@ -604,7 +606,7 @@ return {
if target then
local x, y = wesnoth.find_vacant_tile(target[1], target[2], unit)
local dest = AH.next_hop(unit, x, y)
ai.move(unit, dest[1], dest[2])
AH.checked_move(ai, unit, dest[1], dest[2])
end
end

View file

@ -44,7 +44,7 @@ return {
end
function move_to_any_target:move_to_enemy_exec()
ai.move(self.data.unit, self.data.destination[1], self.data.destination[2])
AH.checked_move(ai, self.data.unit, self.data.destination[1], self.data.destination[2])
end
return move_to_any_target

View file

@ -402,7 +402,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";
lg::wml_error << deprecate_wml_key_warning("target", "1.13.0") << "\n";
config aigoal;
transfer_turns_and_time_of_day_data(aiparam,aigoal);
@ -421,7 +421,7 @@ 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";
lg::wml_error << deprecate_wml_key_warning("protect_unit", "1.13.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);
}
@ -429,7 +429,7 @@ bool configuration::upgrade_side_config_from_1_07_02_to_1_07_03(side_number side
BOOST_FOREACH(config &ai_protect_location, aiparam.child_range("protect_location")) {
lg::wml_error << deprecate_wml_key_warning("protect_location", "1.12.0") << "\n";
lg::wml_error << deprecate_wml_key_warning("protect_location", "1.13.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);
}
@ -438,14 +438,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";
lg::wml_error << deprecate_wml_key_warning("protect_leader", "1.13.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";
lg::wml_error << deprecate_wml_key_warning("protect_leader_radius", "1.13.0") << "\n";
c["radius"] = *v;
}