From 306bdc44df64e2b44909818b488630dc21d66623 Mon Sep 17 00:00:00 2001 From: maj00r Date: Tue, 3 Nov 2026 21:51:54 +0100 Subject: [PATCH] Write the list of launches beside the tapes in one move The tape window reads starter-launch.txt every two seconds. Written in place, the file could be read half written, and a crash during the write lost the launches noted before. --- StarterNG/Application/HaslerTapes.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StarterNG/Application/HaslerTapes.cs b/StarterNG/Application/HaslerTapes.cs index a68731d..df067c0 100644 --- a/StarterNG/Application/HaslerTapes.cs +++ b/StarterNG/Application/HaslerTapes.cs @@ -102,8 +102,8 @@ public sealed class HaslerTapes noted.Add(launch); _files.CreateDirectory(Folder); - _files.WriteAllText(LaunchFile, string.Concat(noted.TakeLast(RememberedLaunches).Select(l => l.Format())), - Encoding.UTF8); + _files.WriteAllTextAtomic(LaunchFile, + string.Concat(noted.TakeLast(RememberedLaunches).Select(l => l.Format()))); lock (_playerLock) _launches = null; }