Permalink
Browse files

Fix crash when unable to find closest enemy.

  • Loading branch information...
Jozrael committed Oct 2, 2017
1 parent f6fbd63 commit e175bb1c7d3fe0fbed919bc2adec231552b5d1a5
Showing with 1 addition and 1 deletion.
  1. +1 −1 data/ai/lua/move_to_any_target.lua
@@ -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)

0 comments on commit e175bb1

Please sign in to comment.