Prechádzať zdrojové kódy

remove minimum 500KB buffer

meidomustard 6 rokov pred
rodič
commit
427dfd07c0

+ 36 - 40
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Update.cs

@@ -4266,55 +4266,51 @@ namespace CM3D2.MultipleMaids.Plugin
                         if (str1.Contains(".menu"))
                         {
                             string str2 = str1;
-                            byte[] f_byBuf = (byte[]) null;
-                            try
+                            byte[] f_byBuf;
+                            using (AFileBase afileBase = GameUty.FileOpen(str2, (AFileSystemBase) null))
                             {
-                                using (AFileBase afileBase = GameUty.FileOpen(str2, (AFileSystemBase) null))
+                                if (flag1 = afileBase.IsValid())
                                 {
-                                    NDebug.Assert(afileBase.IsValid(), "メニューファイルが存在しません。 :" + str2);
-                                    if (f_byBuf == null)
-                                        f_byBuf = new byte[Math.Max(500000, afileBase.GetSize())];
-                                    else if (f_byBuf.Length < afileBase.GetSize())
-                                        f_byBuf = new byte[afileBase.GetSize()];
+                                    f_byBuf = new byte[afileBase.GetSize()];
                                     afileBase.Read(ref f_byBuf, afileBase.GetSize());
                                 }
-
-                                string[] filename2 = ProcScriptBin(maidArray[0], f_byBuf, str2, false);
-                                original1 = ImportCM2.LoadSkinMesh_R(filename2[0], filename2, "", maidArray[0].body0.goSlot[8], 1);
-                                doguBObject.Add(original1);
-                                original1.name = str2;
-                                Vector3 zero1 = Vector3.zero;
-                                Vector3 zero2 = Vector3.zero;
-                                zero1.z = 0.4f;
-                                if (str1.Contains("HandItem"))
+                                else
                                 {
-                                    switch (str1)
-                                    {
-                                        case "HandItemR_WineGlass_I_.menu":
-                                            zero2.z = 90f;
-                                            zero1.y = 0.04f;
-                                            goto case "HandItemL_Dance_Hataki_I_.menu";
-                                        case "HandItemR_WineBottle_I_.menu":
-                                            zero2.z = 90f;
-                                            goto case "HandItemL_Dance_Hataki_I_.menu";
-                                        case "HandItemR_Mop_I_.menu":
-                                            zero2.x = 90f;
-                                            goto case "HandItemL_Dance_Hataki_I_.menu";
-                                        case "HandItemL_Dance_Hataki_I_.menu":
-                                        case "HandItemL_Dance_Mop_I_.menu": break;
-                                        default:
-                                            zero2.x = -90f;
-                                            goto case "HandItemL_Dance_Hataki_I_.menu";
-                                    }
+                                    f_byBuf = null;
                                 }
-
-                                original1.transform.localPosition = zero1;
-                                original1.transform.localRotation = Quaternion.Euler(zero2);
                             }
-                            catch
+
+                            string[] filename2 = ProcScriptBin(maidArray[0], f_byBuf, str2, false);
+                            original1 = ImportCM2.LoadSkinMesh_R(filename2[0], filename2, "", maidArray[0].body0.goSlot[8], 1);
+                            doguBObject.Add(original1);
+                            original1.name = str2;
+                            Vector3 zero1 = Vector3.zero;
+                            Vector3 zero2 = Vector3.zero;
+                            zero1.z = 0.4f;
+                            if (str1.Contains("HandItem"))
                             {
-                                flag1 = true;
+                                switch (str1)
+                                {
+                                    case "HandItemR_WineGlass_I_.menu":
+                                        zero2.z = 90f;
+                                        zero1.y = 0.04f;
+                                        goto case "HandItemL_Dance_Hataki_I_.menu";
+                                    case "HandItemR_WineBottle_I_.menu":
+                                        zero2.z = 90f;
+                                        goto case "HandItemL_Dance_Hataki_I_.menu";
+                                    case "HandItemR_Mop_I_.menu":
+                                        zero2.x = 90f;
+                                        goto case "HandItemL_Dance_Hataki_I_.menu";
+                                    case "HandItemL_Dance_Hataki_I_.menu":
+                                    case "HandItemL_Dance_Mop_I_.menu": break;
+                                    default:
+                                        zero2.x = -90f;
+                                        goto case "HandItemL_Dance_Hataki_I_.menu";
+                                }
                             }
+
+                            original1.transform.localPosition = zero1;
+                            original1.transform.localRotation = Quaternion.Euler(zero2);
                         }
                         else
                         {