Add Patches/NoNull.cs
This commit is contained in:
1 parent
67137ed5c8
commit
2e96ab8f6c
1 file changed
+25
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user