Skip to content

Commit

Permalink
AI: use ai_helper.robust_move_and_attack() in all CAs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsc committed Dec 6, 2019
1 parent 96dd9c1 commit 2cc8cce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/ai/lua/ca_castle_switch.lua
Expand Up @@ -239,7 +239,7 @@ function ca_castle_switch:execution(cfg, data, filter_own)
if AH.print_exec() then AH.print_ts(' Executing castle_switch CA') end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = leader.id, message = 'Switching castles' } end

AH.checked_move(ai, data.CS_leader, data.CS_leader_target[1], data.CS_leader_target[2])
AH.robust_move_and_attack(ai, data.CS_leader, data.CS_leader_target, nil, { partial_move = true })
data.CS_leader, data.CS_leader_target = nil
end

Expand Down
2 changes: 1 addition & 1 deletion data/ai/lua/ca_move_to_any_enemy.lua
Expand Up @@ -71,7 +71,7 @@ end

function ca_move_to_any_enemy:execution(cfg, data)
if AH.print_exec() then AH.print_ts(' Executing move_to_any_enemy CA') end
AH.checked_move_full(ai, MTAE_unit, MTAE_destination[1], MTAE_destination[2])
AH.robust_move_and_attack(ai, MTAE_unit, MTAE_destination)
MTAE_unit, MTAE_destination = nil,nil
end

Expand Down
2 changes: 1 addition & 1 deletion data/ai/lua/ca_village_hunt.lua
Expand Up @@ -92,7 +92,7 @@ end
function ca_village_hunt:execution(cfg, data, filter_own)
if AH.print_exec() then AH.print_ts(' Executing village_hunt CA') end

AH.checked_move_full(ai, VH_unit, VH_dst[1], VH_dst[2])
AH.robust_move_and_attack(ai, VH_unit, VH_dst)
VH_unit, VH_dst = nil, nil
end

Expand Down

0 comments on commit 2cc8cce

Please sign in to comment.