Caused by improperly checking if item names are valid in spawning.lua
lines: 75-84
instead of prototypes[name]
you need to check prototypes.item[name]
, additionally local prototypes
is set earlier to prototypes.entity
so finally you can deal with both by using _G['prototypes'].item[name]
Original mod was skipping over invalid items instead of aborting.
If skipping items is implemented there can be 0 items to insert.
You could replace:
if not prototypes[name] then
util.debugprint("item '" .. name .. "' does not exist")
return
end
local count = expressions.number(count_expression, vars)
if count > 0 then
items[name] = count
end
end
util.safe_insert(e, items)
with:
if not _G['prototypes'].item[name] then
util.debugprint("item '" .. name .. "' does not exist")
log("item '" .. name .. "' does not exist")
else
local count = expressions.number(count_expression, vars)
if count > 0 then
items[name] = count
end
end
end
if not (next(items) == nil) then
util.safe_insert(e, items)
end