Patch_GameScript_EraseCharacter.cs 647 B

12345678910111213141516171819202122232425262728293031
  1. using GadgetCore.API;
  2. using GadgetCore.Util;
  3. using HarmonyLib;
  4. using System;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using System.Reflection;
  8. using System.Reflection.Emit;
  9. using UnityEngine;
  10. namespace VanitySlots.Patches
  11. {
  12. [HarmonyPatch(typeof(GameScript))]
  13. [HarmonyPatch("EraseCharacter")]
  14. [HarmonyGadget("VanitySlots")]
  15. public static class Patch_GameScript_EraseCharacter
  16. {
  17. [HarmonyPrefix]
  18. [HarmonyPriority(Priority.Low)]
  19. public static void Prefix(GameScript __instance)
  20. {
  21. if (!Core.IsSoftcore())
  22. {
  23. Core.itemStore.Clear();
  24. Core.itemStore.Save();
  25. }
  26. }
  27. }
  28. }