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