<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class BackPackTrigger : PickUpTrigger
{
	private StorageObject storageObj;

	void Awake()
	{
		storageObj = GetComponent<StorageObject>();
	}
	public override void UI_InteractOtherSlot(GameObject originator, GameObject item)
	{
		if (item != null)
		{
			//Put item in back without opening it
			//Check if it is a storage obj:
			if (storageObj.NextSpareSlot() != null)
			{
				UIManager.TryUpdateSlot(new UISlotObject(storageObj.NextSpareSlot().UUID, item,
					InventorySlotCache.GetSlotByItem(item)?.inventorySlot.UUID));
					SoundManager.PlayAtPosition("Rustle0" + UnityEngine.Random.Range(1, 6).ToString(), PlayerManager.LocalPlayer.transform.position);

			}
		}
		else
		{
			if (UIManager.StorageHandler.storageCache != storageObj)
			{
				UIManager.StorageHandler.OpenStorageUI(storageObj);
			}
			else
			{
				UIManager.StorageHandler.CloseStorageUI();
			}
		}
	}

	public override void UI_Interact(GameObject originator, string hand)
	{
		if (UIManager.StorageHandler.storageCache != storageObj)
		{
			UIManager.StorageHandler.OpenStorageUI(storageObj);
		}
		else
		{
			UIManager.StorageHandler.CloseStorageUI();
		}
	}

	[Server]
	public override bool ValidatePickUp(GameObject originator, string handSlot = null)
	{
		//Do a sync of the storage items when adding to UI
		storageObj.NotifyPlayer(originator);

		return base.ValidatePickUp(originator, handSlot);
	}
}<commit_msg>[CHANGE] backpacktrigger to return bool<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class BackPackTrigger : PickUpTrigger
{
	private StorageObject storageObj;

	void Awake()
	{
		storageObj = GetComponent<StorageObject>();
	}
	public override bool UI_InteractOtherSlot(GameObject originator, GameObject item)
	{
		if (item != null)
		{
			//Put item in back without opening it
			//Check if it is a storage obj:
			if (storageObj.NextSpareSlot() != null)
			{
				UIManager.TryUpdateSlot(new UISlotObject(storageObj.NextSpareSlot().UUID, item,
					InventorySlotCache.GetSlotByItem(item)?.inventorySlot.UUID));
					SoundManager.PlayAtPosition("Rustle0" + UnityEngine.Random.Range(1, 6).ToString(), PlayerManager.LocalPlayer.transform.position);

			}
		}
		else
		{
			if (UIManager.StorageHandler.storageCache != storageObj)
			{
				UIManager.StorageHandler.OpenStorageUI(storageObj);
			}
			else
			{
				UIManager.StorageHandler.CloseStorageUI();
			}
		}
		return false;
	}

	public override void UI_Interact(GameObject originator, string hand)
	{
		if (UIManager.StorageHandler.storageCache != storageObj)
		{
			UIManager.StorageHandler.OpenStorageUI(storageObj);
		}
		else
		{
			UIManager.StorageHandler.CloseStorageUI();
		}
	}

	[Server]
	public override bool ValidatePickUp(GameObject originator, string handSlot = null)
	{
		//Do a sync of the storage items when adding to UI
		storageObj.NotifyPlayer(originator);

		return base.ValidatePickUp(originator, handSlot);
	}
}
{'fraction_non_alphanumeric': 0.10006435006435006, 'fraction_numerical': 0.0019305019305019305, 'mean_word_length': 4.463971880492092, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5395395', 'n_tokens_mistral': 1082, 'n_tokens_neox': 987, 'n_words': 202}