cibikle / LaSSI

LaSSI (the Last Starship Save Inspector) is a free, open source, cross-platform, fan-made tool for inspecting and editing save files for "The Last Starship" by Introversion Software (https://www.introversion.co.uk/introversion/). Cross-platform UI made possible by Eto (https://github.com/picoe/Eto)
GNU Affero General Public License v3.0
4 stars 3 forks source link

Saving a7 files breaks on MultiSystemSimulation #66

Closed cibikle closed 9 months ago

cibikle commented 9 months ago

SCREWED BY MAGIC NUMBERS AGAIN (and off by one errors) Look at this:

TimeIndex            6765.6793314428114  
NextId               13137  
DeltaTime            0.033333333333333333  
PlayTime             5636.0652837448115  
SaveVersion          3  
ShipArrivalTimer     73.401954491906949  
GameMode             Industry  
MultiSystemSimulation true  

The new keyword MultiSystemSimulation is 22 characters long. Guess what I hardcoded the root pad to. Yeah, 22. So we get this:

TimeIndex            6765.6793314428114  
NextId               13137  
DeltaTime            0.033333333333333333  
PlayTime             5636.0652837448115  
SaveVersion          3  
ShipArrivalTimer     73.401954491906949  
GameMode             Industry  
MultiSystemSimulationtrue 

Simple (dumb) fix: change the 22 to 23. Better fix: get the longest keyword + 1.

cibikle commented 9 months ago

"Best of both" fix: pad is 1. Doesn't look pretty, but that can be its own issue.