Ctrl+S doesn't clear dirty flag.

Posted by WillFa on Wed 07 Jul 2010 08:22 AM — 5 posts, 19,956 views.

USA #0
Press Ctrl+S to save your world. Press Ctrl+F4 immediately afterwards to close the world. You'll still get prompted that "Variables only have changed. Would you like to save?"

"I just did!"


(This still happens on 4.52)
Amended on Wed 07 Jul 2010 08:33 AM by WillFa
Australia Forum Administrator #1
Can't reproduce that. Are you sure that the saving process doesn't change things? For example if the "on save" handler changed a variable, then it might become dirty again.

Or a timer might fire in the short interval after you saved it, and changed something.

Try doing a save, renaming the saved world file, then closing and accepting the offer to save again, then do a diff to see what changes there are between the two files.
USA #2
Nick Gammon said:
For example if the "on save" handler changed a variable, then it might become dirty again.

That seems fishy. Shouldn't the client only save -after- the on-save handlers are called?
Australia Forum Administrator #3
Lol - the flag that said that the variables have changed was never cleared. Thus, once you change a variable it *always* asked you to save the world. I must admit that had niggled at the back of my brain for a while.

Fixed in version 4.53.

The reason is, it used to just set the "dirty" flag - which the OnSave cleared. However once it set its own "variables have changed" flag, this was never cleared, due to a small oversight.

No-one else noticed this either *cough* Twisol *cough*.
USA #4
Pah! I was focused elsewhere. >_>

(Speaking of which, I have a couple other fixes you can expect later!)