[0.18.19] Crash when using rail planner on modded rail entities with order property

This subforum contains all the issues which we already resolved.
Post Reply
tbf
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Apr 22, 2020 12:03 am
Contact:

[0.18.19] Crash when using rail planner on modded rail entities with order property

Post by tbf »

I have the following prototype in the mods directory:

Code: Select all

local recipe = table.deepcopy(data.raw.recipe["rail"])
recipe.enabled = true
recipe.name = "tram-rail"
recipe.ingredients = {{"iron-plate",1}}
recipe.result = "tram-rail"

local tramRail = table.deepcopy(data.raw["rail-planner"]["rail"])
tramRail.name = "tram-rail"
tramRail.straight_rail = "tram-rail-straight"

local tramRailStraight = table.deepcopy(data.raw["straight-rail"]["straight-rail"])
tramRailStraight.name = "tram-rail-straight"
tramRailStraight.order = "a"

data:extend{tramRail,recipe,tramRailStraight}
The entity tramRailStraight is incorrectly assigned an order. After crafting a tram-rail and placing it down in any new world, using the rail planner to extend the track will crash the game immediately.
Attachments
Trams_0.1.0.zip
Stripped down sample
(922 Bytes) Downloaded 97 times
factorio-current.log
Error log
(8 KiB) Downloaded 114 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.19] Crash when using rail planner on modded rail entities with order property

Post by Rseding91 »

Thanks for the report. It's now fixed for the next release.

The issue is the game never checked that what mods defined for straight_rail and curved_rail on the rail-planner item type are built by that rail-planner item.

Specifically, if a rail-planner has "straight_rail" set to an entity, that entities first item-to-build-this must be that rail planner. Same for "curved_rail". In the mod, it's nothing; there is no item-to-place for the curved rail and so it crashes.
If you want to get ahold of me I'm almost always on Discord.

tbf
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Apr 22, 2020 12:03 am
Contact:

Re: [0.18.19] Crash when using rail planner on modded rail entities with order property

Post by tbf »

Neat, thanks for the fix

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.19] Crash when using rail planner on modded rail entities with order property

Post by Rseding91 »

tbf wrote:
Wed Apr 22, 2020 5:12 am
Neat, thanks for the fix
Specifically, the fix checks that the lua definitions are correct and will provide an error message stating what's wrong if they aren't.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”