0.15.12 on_train_created: no old_id when mining

This subforum contains all the issues which we already resolved.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

0.15.12 on_train_created: no old_id when mining

Post by Choumiko »

on_train_created doesn't contain the old_id of the train when mining a locomotive/cargowagon from a train

To reproduce:
Build a train (with at least 2 carriages)
Run:

Code: Select all

/c script.on_event(defines.events.on_train_created, function(e) game.print(string.format("%d : train id: %d, old_train_id_1: %s, old_train_id_2: %s", game.tick, e.train.id, e.old_train_id_1, e.old_train_id_2))end)
Mine any carriage of the train, the print shows nil for both old ids. If you split the train into 2 trains by mining a middle carriage, both on_train_created events have no old_train_id

I'd expect it to have an old_train_id_1, so that a mod could copy/remove the data it may have about that old train.
(Haven't tested if the old LuaTrain is already invalid, but since it doesn't get passed in the event it shouldn't matter)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14339
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: 0.15.12 on_train_created: no old_id when mining

Post by Rseding91 »

Thanks for noticing. It's now fixed for the next version of 0.15.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”