[Lua] Fix obviously broken functions in ai_helper.

These functions are not used anywhere, and they have other issues besides the one fixed in this commit – they're implied to return all moves, but they only return one move for each possibly destination hex. However, this will make them at least be minimally usable.
This commit is contained in:
Celtic Minstrel 2024-02-10 19:46:59 -05:00
parent bb3c95ebbc
commit a2c9d2627e

View file

@ -1436,9 +1436,10 @@ function ai_helper.my_moves()
---@type ai_move[]
local my_moves = {}
for key,value in pairs(dstsrc) do
local hex_x, hex_y = ai_helper.get_LS_xy(key)
table.insert( my_moves,
{ src = { x = value[1].x , y = value[1].y },
dst = { x = key.x , y = key.y }
dst = { x = hex_x , y = hex_y }
}
)
end
@ -1457,9 +1458,10 @@ function ai_helper.enemy_moves()
local enemy_moves = {}
for key,value in pairs(dstsrc) do
local hex_x, hex_y = ai_helper.get_LS_xy(key)
table.insert( enemy_moves,
{ src = { x = value[1].x , y = value[1].y },
dst = { x = key.x , y = key.y }
dst = { x = hex_x , y = hex_y }
}
)
end