Baseless/helpers/CreatePrototype.lua

23 lines
441 B
Lua
Raw Normal View History

2020-04-22 04:35:40 +00:00
function CreatePrototype (type, prototype)
data:extend
{
MergeTables(
prototype,
{
type = type,
name = "dummy-" .. type,
flags = {"hidden"}, -- Make everything hidden
}
),
}
end
-- Does not create if that type already exists
function CreateUniquePrototype (type, prototype)
if data.raw[type] == nil then
CreatePrototype(type, prototype)
return true
end
return false
end