From 2e96ab8f6cc6199d9bce3237e98b542700a427a5 Mon Sep 17 00:00:00 2001 From: Deez Date: Wed, 25 Nov 2026 20:06:12 -0500 Subject: [PATCH] Add Patches/NoNull.cs --- Patches/NoNull.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Patches/NoNull.cs diff --git a/Patches/NoNull.cs b/Patches/NoNull.cs new file mode 100644 index 0000000..f7e8701 --- /dev/null +++ b/Patches/NoNull.cs @@ -0,0 +1,25 @@ +using GorillaNetworking; +using HarmonyLib; +using UnityEngine; + +namespace DeezCosmetx.Patches +{ + [HarmonyPatch(typeof(CosmeticsController.CosmeticSet), "LoadFromPlayerPreferences")] + internal class NoNull : MonoBehaviour + { + private static bool Prefix(CosmeticsController.CosmeticSet __instance, CosmeticsController controller) + { + int num = 16; + + for (int i = 0; i < num; i++) + { + CosmeticsController.CosmeticSlots slot = (CosmeticsController.CosmeticSlots)i; + CosmeticsController.CosmeticItem item = controller.GetItemFromDict(PlayerPrefs.GetString(CosmeticsController.CosmeticSet.SlotPlayerPreferenceName(slot), "NOTHING")); + + __instance.items[i] = item; + } + + return false; + } + } +} \ No newline at end of file