Skip to content

Commit

Permalink
Merge pull request #2072 from Jozrael/master
Browse files Browse the repository at this point in the history
Fix crash when unable to find closest enemy.
  • Loading branch information
mattsc committed Oct 4, 2017
2 parents f6fbd63 + e175bb1 commit c2ca211
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/ai/lua/move_to_any_target.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ return {
-- Find a unit that has a path to an space close to an enemy
for i,u in ipairs(units) do
local distance, target = AH.get_closest_enemy({u.x, u.y})
if target.x then
if target then
unit = u

local x, y = wesnoth.find_vacant_tile(target.x, target.y)
Expand Down

0 comments on commit c2ca211

Please sign in to comment.