[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:
parent
bb3c95ebbc
commit
a2c9d2627e
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue