Fix entity query bindings not making copy of tables they are modifying

This commit is contained in:
DBotThePony 2025-01-01 09:42:56 +07:00
parent 297fb46bde
commit f60ad2a712
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -90,6 +90,8 @@ local entityTypes = {
local function entityTypeNamesToIntegers(input, fullName)
if input then
local output = {}
for i, v in ipairs(input) do
-- could have used string.lower, but original engine does case-sensitive comparison here
-- so we can save quite a lot cpu cycles for ourselves by not doing string.lower
@ -99,10 +101,10 @@ local function entityTypeNamesToIntegers(input, fullName)
error('invalid entity type ' .. tostring(v) .. ' for ' .. fullName .. ' in types table at index ' .. i, 3)
end
input[i] = lookup
output[i] = lookup
end
return input
return output
end
end