diff --git a/src/main/resources/scripts/world.lua b/src/main/resources/scripts/world.lua index 0accd486..f3af6284 100644 --- a/src/main/resources/scripts/world.lua +++ b/src/main/resources/scripts/world.lua @@ -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