From 5c63db1074154143caf4789cd0b1564227e5b79b Mon Sep 17 00:00:00 2001 From: NSGolova Date: Wed, 9 Oct 2024 04:37:37 +0100 Subject: [PATCH] Fixed replay layout editor config reset on game relaunch --- Source/1_Config/SerializableSingleton.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/1_Config/SerializableSingleton.cs b/Source/1_Config/SerializableSingleton.cs index 29bc4c5b..b013fbb6 100644 --- a/Source/1_Config/SerializableSingleton.cs +++ b/Source/1_Config/SerializableSingleton.cs @@ -72,6 +72,9 @@ private static void LoadInternal(string path) { } private static void SaveInternal(string path, object instance) { try { + if (!Directory.Exists(ConfigsPath)) { + Directory.CreateDirectory(ConfigsPath); + } File.WriteAllText(path, JsonConvert.SerializeObject(instance, Formatting.Indented)); } catch (Exception ex) { Plugin.Log.Error($"Failed to save {typeof(T).Name}! \r\n{ex.Message}");