Page 1 of 1

[0.17.12] Crash while saving when assembler holds multiple non-stackable items

Posted: Fri Mar 15, 2019 8:32 am
by OkraDonkey
Mod:
KenirasRandomRecipes

Kenira's mod alters the quantities of ingredients and products of many recipes.
With the default mod settings, the Modular Armor recipe is changed to:
70 x Steel plate + 37 x Advanced circuit = 3 x Modular armor.

If a Save is attempted right after completion of this recipe in an Assembling Machine, while the stack of 3x Modular armor is still in the Assembling Machine output slot, the game will crash.

To reproduce this crash:
Start sandbox game with items; set up an Assembling Machine and solar power.
Set the Assembling Machine to craft Modular Armor.
Add the required ingredients (70 x steel plate and 37 x advanced circuit).
The 3 Modular armor suits will be crafted and will appear in the Assembling Machine's output slot.
Save the game.

What happened:
Crash during save operation

What should happen:
Save without crashing

Stack trace:

Code: Select all

956.077 Error ItemStack.cpp:96: Attempting to save a non-stackable item with a count of > 1: pointer: 0x000001df5c17c860, item pointer: 0x000001df64f70ae0, ID: 200, count: 3, stack size: 1, prototype stack size: 1, prototype type: armor
Note:
The player can remove the three suits from the Assembling Machine without error. The crash only occurs if a save is attempted while the stack exists in the machine.

The attached save file consists only of an Assembling machine which has been set up and configured to craft Modular armor. Just turn the power switch ON. See screenshot.

Thanks!

Re: [0.17.12] Crash while saving when assembler holds multiple non-stackable items

Posted: Fri Mar 15, 2019 1:04 pm
by Rseding91
Thanks for the report. I've fixed it for the next version of 0.17: that recipe should never be able to produce > 1 count of things which the game never allows > 1 count for. In the next version of 0.17 it will error on startup that the recipe is invalid instead of causing corruption/crashes later.

Re: [0.17.12] Crash while saving when assembler holds multiple non-stackable items

Posted: Fri Mar 15, 2019 8:41 pm
by MiniHerc
Rseding91 wrote:
Fri Mar 15, 2019 1:04 pm
Thanks for the report. I've fixed it for the next version of 0.17: that recipe should never be able to produce > 1 count of things which the game never allows > 1 count for. In the next version of 0.17 it will error on startup that the recipe is invalid instead of causing corruption/crashes later.
Instead of fixing it that way, why not fix it so non-stackable items can stack, but only in an assembler, and only if the recipe produces more than 1 of that item?

The OP reported that the recipe worked fine, it's just that the game couldn't make a save under those circumstances.

Re: [0.17.12] Crash while saving when assembler holds multiple non-stackable items

Posted: Fri Mar 15, 2019 8:43 pm
by Rseding91
Ambaire wrote:
Fri Mar 15, 2019 8:41 pm
Rseding91 wrote:
Fri Mar 15, 2019 1:04 pm
Thanks for the report. I've fixed it for the next version of 0.17: that recipe should never be able to produce > 1 count of things which the game never allows > 1 count for. In the next version of 0.17 it will error on startup that the recipe is invalid instead of causing corruption/crashes later.
Instead of fixing it that way, why not fix it so non-stackable items can stack, but only in an assembler, and only if the recipe produces more than 1 of that item?
Because non stackable items are non stackable - by design. We have no plans to make them stackable because it makes no sense for them to stack. Like trying to make a flat sphere... it's not a sphere anymore.