Files
7d2dXG/Mods/0A-KFCommonUtilityLib/Scripts/MinEventActions/MinEventActionRemoveItemFromInventory.cs
Nathaniel Cosford e06f2bd282 Add All Mods
2025-05-29 23:33:28 +09:30

16 lines
508 B
C#

public class MinEventActionRemoveItemFromInventory : MinEventActionItemAccessBase
{
public override bool CanExecute(MinEventTypes _eventType, MinEventParams _params)
{
if (itemValueCache == null)
itemValueCache = ItemClass.GetItem(itemName);
return !_params.Self.isEntityRemote && base.CanExecute(_eventType, _params);
}
public override void Execute(MinEventParams _params)
{
_params.Self.TryRemoveItem(GetCount(_params), itemValueCache);
}
}