17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 02:49:19 +02:00

fix(editor): release the scenario file after load, undo a failed save

This commit is contained in:
2026-10-02 22:54:19 +02:00
parent 3199f3796e
commit a612b0c96c
3 changed files with 32 additions and 2 deletions

View File

@@ -55,6 +55,9 @@ bool scenarioloader_mode::update() {
ErrorLog( "Bad init: scenario loading failed" );
Application.pop_mode();
}
// the loading state holds the scenario file open, which on some systems keeps the file from being replaced
// when the scenery is saved in the editor. it'd also get in the way of another load
state.reset();
WriteLog( "Scenario loading time: " + std::to_string( std::chrono::duration_cast<std::chrono::seconds>( std::chrono::system_clock::now() - timestart ).count() ) + " seconds" );
// TODO: implement and use next mode cue