Skip to content

Commit

Permalink
Fix for weapon priority not working for units that can snipe (FAForev…
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikMekkes authored Nov 9, 2022
1 parent dc68c4b commit 109c66e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/WeaponPriorities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ParseTableOfCategories(inputString)
full = { }
for k, category in categories do
if not (category == '') then
local parsed = cachedTablePriorities[category] or ParseEntityCategory(category)
local parsed = cachedTablePriorities[category] or ParseEntityCategoryProperly(category)
cachedTablePriorities[category] = parsed
if parsed then
table.insert(full, parsed)
Expand Down
6 changes: 6 additions & 0 deletions lua/sim/CategoryUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ function ParseEntityCategoryProperly(categoryExpression)
currentIdentifier = currentIdentifier .. c
end
end)

-- gsub tokenizer stops before end of string character, without a chance to add the last currentidentifier as a token. So need to check once at the end if there is a remaining identifier.
if currentIdentifier ~= "" then
table.insert(tokens, currentIdentifier)
end


local numTokens = table.getn(tokens)

Expand Down

0 comments on commit 109c66e

Please sign in to comment.