From a1ad7d1de3245b179022bc562db8639b677537c8 Mon Sep 17 00:00:00 2001 From: jie65535 Date: Thu, 26 Feb 2026 21:51:38 +0800 Subject: [PATCH] Fix serialization issue in GadgetType.ToTranslatedString --- Source/GrasscutterTools/Game/Props/GadgetType.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/GrasscutterTools/Game/Props/GadgetType.cs b/Source/GrasscutterTools/Game/Props/GadgetType.cs index 54ea6e7..1b2bc92 100644 --- a/Source/GrasscutterTools/Game/Props/GadgetType.cs +++ b/Source/GrasscutterTools/Game/Props/GadgetType.cs @@ -88,7 +88,9 @@ namespace GrasscutterTools.Game.Props public static string ToTranslatedString(string gadgetType, string language) { if (string.IsNullOrEmpty(gadgetType)) gadgetType = "Deprecated"; - return language.StartsWith("zh") ? TextMapCHS[gadgetType] : gadgetType; + if (language.StartsWith("zh") && TextMapCHS.TryGetValue(gadgetType, out var t)) + return t; + return gadgetType; } } } \ No newline at end of file