using GadgetCore.API;
using HarmonyLib;

namespace ScrapYard.Patches
{

  [HarmonyPatch(typeof(GameScript))]
  [HarmonyPatch("Talk")]
  [HarmonyGadget("ScrapYard")]
  public static class Patch_GameScript_Talk
  {
    [HarmonyPrefix]
    public static bool Prefix(GameScript __instance, int a)
    {
      if (a < 0)
      {
        __instance.StartCoroutine(__instance.ExitTalking());
        Core.logger.Log("Stop talking");
        return false;
      }
      return true;
    }
  }
}