[Rseding91] [1.0.0] Savefile corrupts if invalid LuaItemStack is in global table

This subforum contains all the issues which we already resolved.
x2605
Inserter
Inserter
Posts: 42
Joined: Fri Jul 31, 2020 4:08 pm
Contact:

[Rseding91] [1.0.0] Savefile corrupts if invalid LuaItemStack is in global table

Post by x2605 »

corrupt_save_test.zip
(834 Bytes) Downloaded 133 times
I was playing with events, I tried to log every events in global table.
I found a case that allows save without warning but making cannot load the save again.

Reproduce :
- Download scenario and upzip in scenario folder to play it.
- It's writing some LuaObjects caught in event, in global table. Currently only LuaItemStack is written.
- Place a wooden-chest and save it. (Will cause on_built_entity having stack = LuaItemStack as temporary object)
- Try to load it.
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14597
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.0.0] Savefile corrupts if invalid LuaItemStack is in global table

Post by Rseding91 »

Thanks for the report. It's now fixed for the next release. The issue is trying to save the temporary stack given during the on-built-entity event; it's invalid after the event finishes so saving it in global serves no purpose. It's not supposed to crash but that's what is causing it for you.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”