parent
cab4446580
commit
d9e8f69718
4 changed files with 6 additions and 6 deletions
|
@ -1382,7 +1382,7 @@ function ai_helper.get_enemy_dst_src(enemies, cfg)
|
|||
end
|
||||
|
||||
local cfg_copy = {}
|
||||
if cfg then cfg_copy = ai_helper.table_copy(attack_array) end
|
||||
if cfg then cfg_copy = ai_helper.table_copy(cfg) end
|
||||
cfg_copy.moves = 'max'
|
||||
|
||||
return ai_helper.get_dst_src_units(enemies, cfg_copy)
|
||||
|
|
|
@ -1231,10 +1231,10 @@ function battle_calcs.relative_damage_map(units, enemies, cache)
|
|||
-- Get the attack maps for each unit in 'units' and 'enemies'
|
||||
local my_attack_maps, enemy_attack_maps = {}, {}
|
||||
for i,unit in ipairs(units) do
|
||||
my_attack_maps[i] = battle_calcs.get_attack_map_unit(unit, cfg)
|
||||
my_attack_maps[i] = battle_calcs.get_attack_map_unit(unit)
|
||||
end
|
||||
for i,e in ipairs(enemies) do
|
||||
enemy_attack_maps[i] = battle_calcs.get_attack_map_unit(e, cfg)
|
||||
enemy_attack_maps[i] = battle_calcs.get_attack_map_unit(e)
|
||||
end
|
||||
|
||||
-- Get the damage rating for each unit in 'units'. It is the maximum
|
||||
|
|
|
@ -30,7 +30,7 @@ function ca_messenger_move:execution(cfg)
|
|||
|
||||
-- Compare this to the "ideal path"
|
||||
local path = AH.find_path_with_shroud(messenger, x, y, { ignore_units = 'yes' })
|
||||
local optimum_hop, optimum_cost = { messenger.x, messenger.y }, 0
|
||||
local optimum_hop = { messenger.x, messenger.y }
|
||||
for _,step in ipairs(path) do
|
||||
local sub_path, sub_cost = AH.find_path_with_shroud(messenger, step[1], step[2])
|
||||
if sub_cost > messenger.moves then
|
||||
|
@ -47,7 +47,7 @@ function ca_messenger_move:execution(cfg)
|
|||
end
|
||||
|
||||
if not unit_in_way then
|
||||
optimum_hop, nh_cost = step, sub_cost
|
||||
optimum_hop = step
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -46,7 +46,7 @@ function wesnoth.micro_ais.protect_unit(cfg)
|
|||
MAIH.delete_aspects(cfg.side, aspect_parms)
|
||||
-- We also need to add the move_leader_to_keep CA back in
|
||||
-- This works even if it was not removed, it simply overwrites the existing CA
|
||||
wesnoth.side.add_ai_component(side, "stage[main_loop].candidate_action",
|
||||
wesnoth.side.add_ai_component(cfg.side, "stage[main_loop].candidate_action",
|
||||
{
|
||||
id="move_leader_to_keep",
|
||||
engine="cpp",
|
||||
|
|
Loading…
Add table
Reference in a new issue