TommyC81 / TPF2-LineManager

A mod for TPF2 (Transport Fever 2) to manage vehicle numbers on lines.
GNU General Public License v3.0
6 stars 2 forks source link

error reading mission state file #7

Closed Vacuum-Tube closed 2 years ago

Vacuum-Tube commented 2 years ago

Hi, your mod creates an issue that there is a -nan(ind) value (e.g. 0/0) in the state data. This leads to the fact that a savegame is no longer loadable. ("error reading mission state file")

https://www.transportfever.net/index.php?thread/18273-help-save-file-won-t-load/

TommyC81 commented 2 years ago

Thanks, I'll take a look shortly.

On Thu, Jan 20, 2022, 01:43 VacuumTube @.***> wrote:

Hi, your mod creates an issue that there is a -nan(ind) value (e.g. 0/0) in the state data. This leads to the fact that a savegame is no longer loadable. ("error reading mission state file")

https://www.transportfever.net/index.php?thread/18273-help-save-file-won-t-load/

— Reply to this email directly, view it on GitHub https://github.com/TommyC81/TPF2-LineManager/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOQ3XCVCOJLYDUYGFTWRT3UW4V6VANCNFSM5MLCJ5XA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

TommyC81 commented 2 years ago

Thanks for linking the forum, it's obvious where the error is in the state file ("usage = - nan(ind)"). However, I'm unable to locate any obvious reason why this would happen, and have not experienced it myself in any of my own testing/long/big save games.

Your suggested solution in the forum thread is the way to go for now - there is no important state data saved (at this time), just delete the lua file or the erroneous entry. Confusing, this should not really be possible - I've clearly missed some odd edge case that can occur.

[120223] = { capacity = 85, demand = 34, mode = "(D)", name = "Belsize Bus 3", occupancy = 15, rate = 44, samples = 1027, usage = -nan(ind), vehicles = 5, },

TommyC81 commented 2 years ago

Separate note; I'm unable to register on the forum (registration not enabled at this time due to bots?) - please advise the original poster to look here, or simply to confirm that your proposed solution is the way to go (for now).

Also, thank you for submitting the issue! I'll keep it open for now to see if anyone else shows up with the same.

Vacuum-Tube commented 2 years ago

https://github.com/TommyC81/TPF2-LineManager/blob/1fbaf822b3caabb9b2bd8241bcfce610db1569a1/res/scripts/cartok/helper.lua#L340 They can be both 0 and produce nan.

Registering should be possible.

TommyC81 commented 2 years ago

Thanks, you're right! I'll correct this, and probably expand a bit at the same time.

I've also registered now, I mistakenly got the impression that registering had been disabled due to the abuse.

I'll keep this issue open until resolved proper.

TommyC81 commented 2 years ago

Pushed a quick fix for the possibility of the error occurring again a6115409f7784e209868c5cfeed11d393728e599. This will however not fix already occurred errors.

TommyC81 commented 2 years ago

Actually, also changed version of saved state. That skuld invalidate previous saves and resolve the observed issue.

TommyC81 commented 2 years ago

I gather this should be resolved now. Will close the ticket.