23 if ( player.GetCommand_Vehicle() )
27 if (
Class.
CastTo( garden_base, target.GetObject() ) )
32 garden_base.GetActionComponentNameList( target.GetComponentIndex(), selections );
35 for (
int s = 0; s < selections.Count(); s++)
37 selection = selections[s];
38 slot = garden_base.GetSlotBySelection( selection );
44 if ( slot && slot.GetSeed() )
46 if ( slot.GetWateredState() != 0 )
53 if ( player.GetInventory().CanAddEntityIntoInventory(
m_Seed ) &&
m_Seed.GetHierarchyRootPlayer() != player )
56 return player.GetInventory().CanAddEntityIntoHands(
m_Seed );
72 if ( action_data.
m_Player.GetInventory().HasInventoryReservation(
m_Seed, il ) )
101 if ( !player.GetInventory().CanAddEntityIntoHands(
m_Seed ) )
105 m_Seed.GetInventory().GetCurrentInventoryLocation( targetInventoryLocation );
109 if ( stackable == 0 || stackable >=
m_Seed.GetQuantity() )
111 player.PredictiveTakeToDst( targetInventoryLocation, il );
115 m_Seed.SplitIntoStackMaxToInventoryLocationClient( il );
123 stackable =
m_Seed.GetTargetQuantityMax( -1 );
125 if ( stackable == 0 || stackable >=
m_Seed.GetQuantity() )
133 m_Seed.SplitIntoStackMaxToInventoryLocationClient( il );
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void ClearInventoryReservationEx(ActionData action_data)
class ActionTargets ActionTarget
FindInventoryLocationType
flags for searching locations in inventory
ref array< ref InventoryLocation > m_ReservedInventoryLocations
override void CreateConditionComponents()
override bool InventoryReservation(ActionData action_data)
override void OnExecute(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Super root of all classes in Enforce script.
script counterpart to engine's class Inventory
const int c_InventoryReservationTimeoutMS
reservations
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
proto native int GetSlot()
returns slot id if current type is Attachment
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.