fix fe+ compatibility

This commit is contained in:
Brevven 2020-12-07 03:12:35 -08:00
parent ea825853d0
commit 9a650c09fc
3 changed files with 20 additions and 9 deletions

View file

@ -10,16 +10,12 @@ end
-- Remove an element of type t and name from data.raw
function data_util.remove_raw(t, name)
local index = -1
for i, elem in pairs(data.raw) do
if elem.type == t and elem.name == name then
index = i
for i, elem in pairs(data.raw[t]) do
if elem.name == name then
data.raw[t][i] = nil
break
end
end
if index > -1 then
table.remove(data.raw, index)
end
end