Code: Select all
/c for i, option in pairs(game.player.crafting_queue) do game.player.cancel_crafting({index=1,count=option['count']}) end
before: after: This is probably due to the fact that if the intermediate product is canceled(blue slot), the main product is also canceled, and as a result, the main product index becomes invalid.
If in the crafting queue no intermediate products, the error does not appear.
I also tried using these indexes.But the result is even worse:
Code: Select all
/c for i, option in pairs(game.player.crafting_queue) do game.player.cancel_crafting({index=option['index'],count=option['count']}) end
/c for i, option in pairs(game.player.crafting_queue) do game.player.cancel_crafting({index=i,count=option['count']}) end