parent
0c7ea59613
commit
23fc509256
3 changed files with 5 additions and 5 deletions
|
@ -1176,7 +1176,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)
|
||||
|
|
|
@ -1237,10 +1237,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
|
||||
|
|
Loading…
Add table
Reference in a new issue