From 681362b146e11ba4d6bc98e60637af1257b3b3f7 Mon Sep 17 00:00:00 2001 From: kremnev8 Date: Thu, 17 Feb 2022 18:48:51 +0300 Subject: [PATCH] Fix chat breaking if player loads the save multiple times. --- NebulaWorld/Chat/EmojiDataManager.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NebulaWorld/Chat/EmojiDataManager.cs b/NebulaWorld/Chat/EmojiDataManager.cs index 7e5b998c8..c111076d5 100644 --- a/NebulaWorld/Chat/EmojiDataManager.cs +++ b/NebulaWorld/Chat/EmojiDataManager.cs @@ -33,6 +33,7 @@ public Emoji(Dictionary dict) public static class EmojiDataManager { public static Dictionary> emojies = new Dictionary>(); + private static bool isLoaded = false; private static void Add(Emoji emoji) { @@ -49,6 +50,8 @@ private static void Add(Emoji emoji) public static void ParseData(TextAsset asset) { + if (isLoaded) return; + string json = "{\"frames\":" + asset.text + "}"; if (MiniJson.Deserialize(json) is Dictionary jObject) @@ -74,6 +77,8 @@ public static void ParseData(TextAsset asset) { kv.Value.Sort((emoji1, emoji2) => emoji1.SortOrder.CompareTo(emoji2.SortOrder)); } + + isLoaded = true; } } } \ No newline at end of file