Goto MAI: fix bug causing errors for unreachable goal hexes
This includes hexes occupied by an enemy unit.
This commit is contained in:
parent
20370a99b8
commit
607f91a473
1 changed files with 6 additions and 1 deletions
|
@ -200,7 +200,12 @@ function ca_goto:execution(ai, cfg, self)
|
|||
end
|
||||
end
|
||||
|
||||
AH.checked_move_full(ai, best_unit, closest_hex[1], closest_hex[2])
|
||||
if closest_hex then
|
||||
AH.checked_move_full(ai, best_unit, closest_hex[1], closest_hex[2])
|
||||
else
|
||||
AH.checked_stopunit_moves(ai, best_unit)
|
||||
end
|
||||
|
||||
if (not best_unit) or (not best_unit.valid) then return end
|
||||
|
||||
-- If release_unit_at_goal= or release_all_units_at_goal= key is set:
|
||||
|
|
Loading…
Add table
Reference in a new issue