Page 1 of 1

[0.10.x][slpwnd] Save file lost if lua error in onsave.

Posted: Wed Aug 13, 2014 9:09 pm
by rk84
If you try to save over an old savefile, saving can fails due to lua error. You will loose the file you are overwriting and possibly the currently active game, if it crashes.

Possiple steps:
1.Make new game
2.Save it
3.Type this code to console

Code: Select all

game.onsave(function() error("bye-bye") end)
4.Try to save again


I was able to crash it too, when I tried calling error without any parameters. It left me 2kB zip and when I tried unzip it, XP asked to insert last floppy in drive :lol:

Re: [0.10.x][slpwnd] Save file lost if lua error in onsave.

Posted: Fri Aug 15, 2014 8:37 am
by slpwnd
Thanks for the report. In 0.10.7 the save is first done to the temporary location and only if it succeeds it is moved over to where it should go.