[2.0.47] Crash loading a save when type of a cargo wagon inside an undo action changed to inifinity cargo wagon
Posted: Fri May 09, 2025 11:07 am
1. Create a mod with following code in data.lua
2. Load the following save file (syncing mods is not necessary):
3. Game crashes
To make the save file, i commented out the line, restarted the game and placed the flatbed wagon from the editor, which placed it into the undo queue.
Code: Select all
local flatbed_wagon = table.deepcopy(data.raw["cargo-wagon"]["cargo-wagon"])
flatbed_wagon.type = "infinity-cargo-wagon"
flatbed_wagon.name = "flatbed-wagon"
flatbed_wagon.placeable_by = {item="flatbed-wagon", count=1}
flatbed_wagon.minable = {mining_time = 1, result = "flatbed-wagon"}
data:extend{flatbed_wagon}
data:extend{
{
type = "item-with-entity-data",
name = "flatbed-wagon",
icon = "__base__/graphics/icons/cargo-wagon.png",
icon_size = 64,
place_result = "flatbed-wagon",
stack_size = 5
},
}
To make the save file, i commented out the line
Code: Select all
flatbed_wagon.type = "infinity-cargo-wagon"