From bab5b53ac3489bc2e0c223fe15fb81e39baceeee Mon Sep 17 00:00:00 2001 From: Sauceke <76826783+Sauceke@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:53:32 +0300 Subject: [PATCH] Make sure sum of weights doesn't exceed 1 --- KK_SexFaces/FacialExpression.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/KK_SexFaces/FacialExpression.cs b/KK_SexFaces/FacialExpression.cs index 6937c00..1bec4e0 100644 --- a/KK_SexFaces/FacialExpression.cs +++ b/KK_SexFaces/FacialExpression.cs @@ -93,12 +93,13 @@ private static Dictionary GetExpression(FBSBase fbs) => Traverse.Create(fbs).Field>("dictNowFace").Value; private static string DictToString(Dictionary dict) => dict - .Select(pair => pair.Key + ":" + pair.Value) + .Select(pair => pair.Key + ":" + pair.Value.ToString("F4")) .Aggregate("", (a, b) => a + ";" + b); private static Dictionary StringToDict(string s) => s.Split(';').Skip(1).ToDictionary( pair => int.Parse(pair.Split(':')[0]), pair => float.Parse(pair.Split(':')[1])); + } } \ No newline at end of file