Upload from upload_mods.ps1
This commit is contained in:
34
Harmony/Harmony_XUiM_PlayerInventory.cs
Normal file
34
Harmony/Harmony_XUiM_PlayerInventory.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
using Audio;
|
||||
|
||||
namespace Harmony.XUiM_PlayerInventoryPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(XUiM_PlayerInventory))]
|
||||
[HarmonyPatch("DropItem")]
|
||||
public class DropItemPatch
|
||||
{
|
||||
public static bool Prefix(XUiM_PlayerInventory __instance, ItemStack stack)
|
||||
{
|
||||
GameManager instance = GameManager.Instance;
|
||||
if ((bool)(UnityEngine.Object)instance)
|
||||
{
|
||||
int playerid = __instance.localPlayer.entityId;
|
||||
|
||||
bool isArrow = stack.itemValue.ItemClass.Name.ToLower().Contains("ammoarrow") ||
|
||||
stack.itemValue.ItemClass.Name.ToLower().Contains("ammocrossbowbolt");
|
||||
|
||||
if (isArrow)
|
||||
{
|
||||
playerid = -1;
|
||||
}
|
||||
|
||||
instance.ItemDropServer(stack, __instance.localPlayer.GetDropPosition(), Vector3.zero, playerid, 60f, false);
|
||||
Manager.BroadcastPlay("itemdropped");
|
||||
}
|
||||
__instance.xui.CollectedItemList?.RemoveItemStack(stack);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user