Prevent saving during the tutorial - #700
Conversation
NicholasBatesNZ
left a comment
There was a problem hiding this comment.
Thanks for this, and sorry it sat for so long — it's still needed, #699 is open and I confirmed the autosave timer still overwrites the real save the moment the tutorial starts. I traced every write path on current develop (writeShips, saveWorld, SerialisationManager.serialise) and with this patch they're all covered, so the coverage side looks complete.
One thing to fix before merge though: in StarPort the && !game.isTutorial() guard also skips setTranscendent() (line 127) and setSolShip() (line 405), not just the save — so a tutorial player who uses a star port ends up detached from their ship, since removeObjDelayed(ship) still runs. Star ports are generated in the tutorial world too and the 200 starting credits cover the 10-credit fare, so it's reachable.
Could you keep the isPlayer() check on the outer if and nest only the SaveManager.saveWorld(...) call inside a !game.isTutorial() check? Happy to merge once that's in — no objection to this being a stopgap ahead of a proper SaveManager fix.
Description
This pull request attempts to fix areas where the game still saves whilst the tutorial is active. This is only a temporary solution and changes to
SaveManagermay provide a more comprehensive one in the future.Testing
This should fix #699.