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() != eWateredState.DRY)
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 ) )
85 action_data.m_ReservedInventoryLocations.Insert( il );
93 super.OnExecuteClient(action_data);
100 if ( !player.GetInventory().CanAddEntityIntoHands(
m_Seed ) )
102 il = action_data.m_ReservedInventoryLocations.Get( 0 );
104 m_Seed.GetInventory().GetCurrentInventoryLocation( targetInventoryLocation );
109 if ( stackable == 0 || stackable >=
m_Seed.GetQuantity() )
111 player.PredictiveTakeToDst( targetInventoryLocation, il );
115 m_Seed.SplitIntoStackMaxToInventoryLocationClient( il );
122 stackable =
m_Seed.GetTargetQuantityMax( -1 );
124 if ( stackable == 0 || stackable >=
m_Seed.GetQuantity() )
126 action_data.m_Player.PredictiveTakeEntityToHands(
m_Seed );
132 m_Seed.SplitIntoStackMaxToInventoryLocationClient( il );
class ActionTargets ActionTarget
FindInventoryLocationType
flags for searching locations in inventory
ref CCIBase m_ConditionItem
void ClearInventoryReservationEx(ActionData action_data)
ref CCTBase m_ConditionTarget
void ActionInteractBase()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool InventoryReservation(ActionData action_data)
override void OnExecuteClient(ActionData action_data)
override void CreateConditionComponents()
Super root of all classes in Enforce script.
const int c_InventoryReservationTimeoutMS
reservations
script counterpart to engine's class Inventory
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.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.