Browse Source

[2.0.3.9] Fixed __state

Zariteis 4 years ago
parent
commit
1819d1dc71
1 changed files with 5 additions and 5 deletions
  1. 5 5
      Patches/Patch_GameScript_UpgradeStorage.cs

+ 5 - 5
Patches/Patch_GameScript_UpgradeStorage.cs

@@ -10,22 +10,22 @@ namespace IronmanChest.Patches
   public static class Patch_GameScript_UpgradeStorage
   {
     [HarmonyPrefix]
-    public static void Prefix(GameScript __instance, Item[] ___storage, ref int ___storageLevel, out int __originalStorageLevel)
+    public static void Prefix(GameScript __instance, Item[] ___storage, ref int ___storageLevel, out int __state)
     {
-      __originalStorageLevel = -1;
+      __state = -1;
       if (Menuu.curProfession == 1)
       {
-        __originalStorageLevel = PreviewLabs.PlayerPrefs.GetInt("storageLevel");
+        __state = PreviewLabs.PlayerPrefs.GetInt("storageLevel");
       }
     }
 
     [HarmonyPostfix]
     [HarmonyPriority(Priority.Low)]
-    public static void Postfix(GameScript __instance, Item[] ___storage, ref int ___storageLevel, int __originalStorageLevel)
+    public static void Postfix(GameScript __instance, Item[] ___storage, ref int ___storageLevel, int __state)
     {
       if (Menuu.curProfession == 1)
       {
-        PreviewLabs.PlayerPrefs.SetInt("storageLevel", __originalStorageLevel);
+        PreviewLabs.PlayerPrefs.SetInt("storageLevel", __state);
         PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorageLevel", ___storageLevel);
       }
     }