<commit_before>﻿using System;
using System.Collections;
using UnityEngine;
using Mirror;

/// <summary>
///     Indicates an edible object.
/// </summary>
public class Edible : NetworkBehaviour, IClientInteractable<HandActivate>, IClientInteractable<HandApply>
{
	public GameObject leavings;
	protected bool isDrink = false;

	public int nutritionLevel = 5;

	private void Awake()
	{
		GetComponent<ItemAttributesV2>().AddTrait(CommonTraits.Instance.Food);
	}

	public virtual void TryEat()
	{
		//FIXME: PNA Cmd is being used to heal the player instead of heal hunger for the TDM
		PlayerManager.LocalPlayerScript.playerNetworkActions.CmdEatFood(gameObject,
            UIManager.Hands.CurrentSlot.NamedSlot, isDrink);
	}

	/// <summary>
	/// Used by NPC's' server side
	/// </summary>
	public void NPCTryEat()
	{
		SoundManager.PlayNetworkedAtPos("EatFood", transform.position);
		//Keeping this out allows food to be eaten and disappeared, change to despawn at some point.
		/*if (leavings != null)
		{
			Spawn.ServerPrefab(leavings, transform.position, transform.parent);
		}*/

		GetComponent<CustomNetTransform>().DisappearFromWorldServer();
	}

	public bool Interact(HandActivate interaction)
	{
		//eat on activate
		TryEat();
		return true;
	}

	public bool Interact(HandApply interaction)
	{
		//eat when we hand apply to ourselves
		if (interaction.Performer == PlayerManager.LocalPlayer &&
		    interaction.HandObject == gameObject
		    && interaction.TargetObject == PlayerManager.LocalPlayer)
		{<commit_msg>Properly Updated without a typo<commit_after>﻿using System;
using System.Collections;
using UnityEngine;
using Mirror;

/// <summary>
///     Indicates an edible object.
/// </summary>
public class Edible : NetworkBehaviour, IClientInteractable<HandActivate>, IClientInteractable<HandApply>
{
	public GameObject leavings;
	protected bool isDrink = false;

	public int nutritionLevel = 5;

	private void Awake()
	{
		GetComponent<ItemAttributesV2>().AddTrait(CommonTraits.Instance.Food);
	}

	public virtual void TryEat()
	{
		//FIXME: PNA Cmd is being used to heal the player instead of heal hunger for the TDM
		PlayerManager.LocalPlayerScript.playerNetworkActions.CmdEatFood(gameObject,
            UIManager.Hands.CurrentSlot.NamedSlot, isDrink);
	}

	/// <summary>
	/// Used by NPC's' server side
	/// </summary>
	public void NPCTryEat()
	{
		SoundManager.PlayNetworkedAtPos("EatFood", transform.position);
		if (leavings != null)
		{
			Spawn.ServerPrefab(leavings, transform.position, transform.parent);
		}

		GetComponent<CustomNetTransform>().DisappearFromWorldServer();
	}

	public bool Interact(HandActivate interaction)
	{
		//eat on activate
		TryEat();
		return true;
	}

	public bool Interact(HandApply interaction)
	{
		//eat when we hand apply to ourselves
		if (interaction.Performer == PlayerManager.LocalPlayer &&
		    interaction.HandObject == gameObject
		    && interaction.TargetObject == PlayerManager.LocalPlayer)
		{
{'fraction_non_alphanumeric': 0.10508588750421018, 'fraction_numerical': 0.0013472549680026945, 'mean_word_length': 4.26595744680851, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '515581', 'n_tokens_mistral': 976, 'n_tokens_neox': 905, 'n_words': 232}