[Lua] Avoid reusing no-longer-needed variables for different meanings

This raises Lua warnings about mismatched types
This commit is contained in:
Celtic Minstrel 2024-02-04 14:15:16 -05:00
parent f19b7829c7
commit 1efc2fbe4d
2 changed files with 2 additions and 6 deletions

View file

@ -1046,10 +1046,7 @@ function ai_helper.split_location_list_to_strings(list)
locsx[i] = loc[1]
locsy[i] = loc[2]
end
locsx = table.concat(locsx, ",")
locsy = table.concat(locsy, ",")
return locsx, locsy
return table.concat(locsx, ","), table.concat(locsy, ",")
end
---Returns a location set of hexes to be avoided by the AI. Information about

View file

@ -116,8 +116,7 @@ function wml_actions.store_unit_type_ids(cfg)
table.insert(types, k)
end
table.sort(types)
types = table.concat(types, ',')
wml.variables[cfg.variable or "unit_type_ids"] = types
wml.variables[cfg.variable or "unit_type_ids"] = table.concat(types, ',')
end
function wml_actions.store_unit_type(cfg)