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
[0.12.10][posila]Remove Rail mod -> unloadable save
Re: [0.12.10][posila]Remove Rail mod -> unloadable save
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.
I had to split "rail" entity type into "straight-rail" and "curved-rail" so you will need to adjust your mod.
Re: [0.12.10][posila]Remove Rail mod -> unloadable save
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 wrote:I had to split "rail" entity type into "straight-rail" and "curved-rail" so you will need to adjust your mod.
Re: [0.12.10][posila]Remove Rail mod -> unloadable save
Unfortunately, that is right. If it turns out to be performance problem for FARL, let us know.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?
Re: [0.12.10][posila]Remove Rail mod -> unloadable save
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 requestposila wrote:Unfortunately, that is right. If it turns out to be performance problem for FARL, let us know.