Crafting Combinator


Includes combinators that allow you to set or read the recipe of any crafting machine, get ingredients or products of a recipe and more!

Content
2 years ago
0.14 - 1.1
18.2K
Manufacturing

b An error while destroying entity

7 years ago
(updated 7 years ago)

When I destroyed Crafting Combinator I got this error:

Error while running event on_tick (ID 0)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
crafting_combinator/control.lua:38: in function 'get_recipe_from_wire'
crafting_combinator/control.lua:56: in function 'get_recipe'
crafting_combinator/control.lua:123: in function <crafting_combinator/control.lua:115>

If it helps, I had no wires attached, it wasn't connected to anything.

Edit:
Did some testing, it also crashes when Recipe Combinator is destroyed.

7 years ago
(updated 7 years ago)

Was it a combinator that you placed in a previous version (which one)?
I changed how the mod works internally a bit so it is possible that's the issue. I may try to write a migration script if that's the case.
Cheers TRK
Edit: Didn't see your edit - That is almost certainly a problem with the internal changes - migration script it is.
You should be able to solve this for now by disabling the mod, saving your game and enabling it if you don't mind the combinators getting lost.
I hope I'll be able to fix this today tho so you can revert to 0.1.4 and wait for the new version.

7 years ago

This is weird, I've been trying to replicate this for a while now and didn't succeed...
Could I get your save by chance?

7 years ago
(updated 7 years ago)

I don't really have a save where I use this mod particulary. I created new base/sandbox scenario with default map generator options for testing purposes. It crashed there. I blamed my mods at first but just tried to launch this single mod only and it still gives the same error.

Edit:
I think I fixed it by checking if entity is valid in 2 places in control.lua. So far it didn't crash.

Source if you need it: http://pastebin.com/hSV4Q0sq
I added "--CHECK" comment before every edit.

7 years ago

Oh, my derp - [i] was missing (see GitHub if you want to know where).
For some reason, I didn't test it on a new world...

The weird thing is - it should have never worked but when I tested it on existing saves, it did work... Magic?!

Anyway it's fixed in 0.2.1. Sorry for the inconvenience, I hope I won't screw up like this anymore...
Cheers TRK

New response