Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when attempting to stack an item with no subgroup #35

Open
Mernom opened this issue Jul 28, 2023 · 0 comments
Open

Crash when attempting to stack an item with no subgroup #35

Mernom opened this issue Jul 28, 2023 · 0 comments

Comments

@Mernom
Copy link

Mernom commented Jul 28, 2023

Error log:

Failed to load mods: __deadlock-beltboxes-loaders__/prototypes/create_stack.lua:19: attempt to index field '?' (a nil value)
stack traceback:
	__deadlock-beltboxes-loaders__/prototypes/create_stack.lua:19: in function 'get_group'
	__deadlock-beltboxes-loaders__/prototypes/create_stack.lua:79: in function 'create_stacked_item'
	__deadlock-beltboxes-loaders__/prototypes/public.lua:194: in function 'add_stack'
	__personal__/data-final-fixes.lua:104: in main chunk

Code to reproduce:

if deadlock_stacking then
  local new_item = table.deepcopy (data.raw.item.wood)
  new_item.name = "test-item"
  new_item.subgroup = nil
  data:extend { new_item }
  deadlock.add_stack ( "test-item" )
end

Suggestion: add a fallback to the ... [data.raw[item_type][item].subgroup].group ... part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant