Railwave


Adds a smart train stop with built-in load, unload, depot, and fuel station logic.

Content
3 days ago
2.0
194
Trains

b Crash on blueprinting a smart stop from the blueprint library (`valid_for_read` on LuaRecord)

a month ago

Nice mod, this seems much friendlier than LTN! After some testing, I ran into a bug though.

The mod Railwave (0.1.1) caused a non-recoverable error.
Error while running event railwave::on_player_setup_blueprint (ID 83)
LuaRecord doesn't contain key valid_for_read.
control.lua:2753

To reproduce, make a mall that has the new station in it, then update a blueprint with the new version of this mall.

It's the on_player_setup_blueprint, event.stack or event.record which can return a LuaRecord. The validity check then reads blueprint.valid_for_read, which only exists on LuaItemStack, not on LuaRecord so it causes a crash

I fixed it manually by guarding valid_for_read to stacks only. I tested it, and it works

local blueprint = event.stack or event.record
if not (blueprint and blueprint.valid) then return end
if blueprint.object_name == "LuaItemStack" and not blueprint.valid_for_read then return end
15 days ago

Thank you, good find.
I patched it and uploaded a new version

New response