[0.12.10][posila]Remove Rail mod -> unloadable save

This subforum contains all the issues which we already resolved.
Razaekel
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Oct 06, 2015 2:33 am
Contact:

[0.12.10][posila]Remove Rail mod -> unloadable save

Post by Razaekel »

Issue:

Removing a rail mod (Ex: Concreted Rails) from the modlist and then loading a save with modded rails placed down results in aborting the load and the following message: 'Entity cannot be destroyed'.

Replication:

1. Start a game with a rail mod enabled (Concreted Rails, I assume Tug would do this too).
2. place down a rail from the rail mod.
3. Save and exit.
4. Disable the rail mod.
5. Restart Factorio.
6. Load the save.
7. Cry (no not really).

Attachments:
Rail mod (Concreted Rails)
Save with the rail mod installed
posila
Factorio Staff
Factorio Staff
Posts: 5349
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.12.10][posila]Remove Rail mod -> unloadable save

Post by posila »

This was hard one. Thanks for the report. Fixed for 0.12.11 (only for saves 0.12.11+)
I had to split "rail" entity type into "straight-rail" and "curved-rail" so you will need to adjust your mod.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.12.10][posila]Remove Rail mod -> unloadable save

Post by Choumiko »

posila wrote:I had to split "rail" entity type into "straight-rail" and "curved-rail" so you will need to adjust your mod.
This means any call to LuaSurface:find_entities_filtered with type = "rail" will have to be rewritten to to type = "straight-rail" and a second call with type = "curved-rail", right?
posila
Factorio Staff
Factorio Staff
Posts: 5349
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.12.10][posila]Remove Rail mod -> unloadable save

Post by posila »

Choumiko wrote:This means any call to LuaSurface:find_entities_filtered with type = "rail" will have to be rewritten to to type = "straight-rail" and a second call with type = "curved-rail", right?
Unfortunately, that is right. If it turns out to be performance problem for FARL, let us know.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.12.10][posila]Remove Rail mod -> unloadable save

Post by Choumiko »

posila wrote:Unfortunately, that is right. If it turns out to be performance problem for FARL, let us know.
I just checked the code, most of the time i'm using name instead of type anyways. One search for type can now be replaced by LuaTrain::front_rail, the others might actually be better replaced by an unfiltered search, since i'm calling that for 5+ different types. And i just had an idea for a API request :D
Post Reply

Return to “Resolved Problems and Bugs”