Merge pull request #2072 from Jozrael/master

Fix crash when unable to find closest enemy.
This commit is contained in:
mattsc 2017-10-03 20:10:49 -07:00 committed by GitHub
commit c2ca21141b

View file

@ -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)