Quellcode durchsuchen

[2.0.3.9] ConvertIDToHost/ConvertIDToLocal

Zariteis vor 4 Jahren
Ursprung
Commit
d537dd0bd1
3 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen
  1. 6 6
      Patches/Patch_NetworkView_RPC.cs
  2. 1 1
      VanitySlots.cs
  3. 1 1
      VanitySlots.sln

+ 6 - 6
Patches/Patch_NetworkView_RPC.cs

@@ -17,20 +17,20 @@ namespace VanitySlots.Patches
       if (name == "UA" && args[0] is int[] a && a.Length > 6)
       {
         if (Core.itemStore.Items[0].id != 0)
-          if (ItemRegistry.GetItem(Core.itemStore.Items[0].id).GetName().StartsWith("Original "))
+          if (ItemRegistry.GetItem(GadgetNetwork.ConvertIDToLocal(ItemRegistry.Singleton, Core.itemStore.Items[0].id)).GetName().StartsWith("Original "))
             a[1] = 0;
           else
-            a[1] = Core.itemStore.Items[0].id;
+            a[1] = GadgetNetwork.ConvertIDToHost(ItemRegistry.Singleton, Core.itemStore.Items[0].id);
         if (Core.itemStore.Items[1].id != 0)
-          if (ItemRegistry.GetItem(Core.itemStore.Items[1].id).GetName().StartsWith("Original "))
+          if (ItemRegistry.GetItem(GadgetNetwork.ConvertIDToLocal(ItemRegistry.Singleton, Core.itemStore.Items[1].id)).GetName().StartsWith("Original "))
             a[2] = 0;
           else
-            a[2] = Core.itemStore.Items[1].id;
+            a[2] = GadgetNetwork.ConvertIDToHost(ItemRegistry.Singleton, Core.itemStore.Items[1].id);
         if (Core.itemStore.Items[2].id != 0)
-          if (ItemRegistry.GetItem(Core.itemStore.Items[2].id).GetName().StartsWith("Original "))
+          if (ItemRegistry.GetItem(GadgetNetwork.ConvertIDToLocal(ItemRegistry.Singleton, Core.itemStore.Items[2].id)).GetName().StartsWith("Original "))
             a[3] = 0;
           else
-            a[3] = Core.itemStore.Items[2].id;
+            a[3] = GadgetNetwork.ConvertIDToHost(ItemRegistry.Singleton, Core.itemStore.Items[2].id);
       }
     }
   }

+ 1 - 1
VanitySlots.cs

@@ -8,7 +8,7 @@ namespace VanitySlots
   [Gadget("VanitySlots", RequiredOnClients: false)]
   public class VanitySlots : Gadget<VanitySlots>
   {
-    public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
+    public const string MOD_VERSION = "1.1"; // Set this to the version of your mod.
     public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
 
     public override IGadgetConfigMenu GetConfigMenu() { return null; }

+ 1 - 1
VanitySlots.sln

@@ -17,6 +17,6 @@ Global
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {631188D6-9FFC-4F2E-9ED5-E35379E64351}
+		SolutionGuid = {33B435C9-F21A-4854-ABBC-713E72C64FB3}
 	EndGlobalSection
 EndGlobal