ai_helper.get_closest_location(): fix bug with tags in SLF
The way how the Standard Location Filter was dealt with only worked with keys, not tags.
This commit is contained in:
parent
15a4c1f74c
commit
9e6b780306
1 changed files with 2 additions and 1 deletions
|
@ -485,14 +485,15 @@ function ai_helper.get_closest_location(hex, location_filter, unit)
|
|||
if (radius == 0) then
|
||||
loc_filter = {
|
||||
{ "and", { x = hex[1], y = hex[2], radius = radius } },
|
||||
{ "and", location_filter }
|
||||
}
|
||||
else
|
||||
loc_filter = {
|
||||
{ "and", { x = hex[1], y = hex[2], radius = radius } },
|
||||
{ "not", { x = hex[1], y = hex[2], radius = radius - 1 } },
|
||||
{ "and", location_filter }
|
||||
}
|
||||
end
|
||||
for k,v in pairs(location_filter) do loc_filter[k] = v end
|
||||
|
||||
local locs = wesnoth.get_locations(loc_filter)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue