DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnExecuteClient()

override void ActionRemoveSeed::OnExecuteClient ( ActionData action_data)
inlineprivate

См. определение в файле ActionRemoveSeed.c строка 91

92 {
93 super.OnExecuteClient(action_data);
94
95 PlayerBase player = action_data.m_Player;
96 float stackable;
97 InventoryLocation il;
98
99 //We place in inventory
100 if ( !player.GetInventory().CanAddEntityIntoHands( m_Seed ) )
101 {
102 il = action_data.m_ReservedInventoryLocations.Get( 0 );
103 InventoryLocation targetInventoryLocation = new InventoryLocation;
104 m_Seed.GetInventory().GetCurrentInventoryLocation( targetInventoryLocation );
105
106 stackable = m_Seed.GetTargetQuantityMax( il.GetSlot() );
107
108 ClearInventoryReservationEx(action_data);
109 if ( stackable == 0 || stackable >= m_Seed.GetQuantity() )
110 {
111 player.PredictiveTakeToDst( targetInventoryLocation, il );
112 }
113 else
114 {
115 m_Seed.SplitIntoStackMaxToInventoryLocationClient( il );
116 }
117 }
118 else
119 {
120 //We place in hands
121 ClearInventoryReservationEx(action_data);
122 stackable = m_Seed.GetTargetQuantityMax( -1 );
123
124 if ( stackable == 0 || stackable >= m_Seed.GetQuantity() )
125 {
126 action_data.m_Player.PredictiveTakeEntityToHands( m_Seed );
127 }
128 else
129 {
130 il = new InventoryLocation;
131 il.SetHands( action_data.m_Player, m_Seed );
132 m_Seed.SplitIntoStackMaxToInventoryLocationClient( il );
133 }
134 }
135 }
void ClearInventoryReservationEx(ActionData action_data)
Определения ActionBase.c:1025
SeedBase m_Seed
Определения ActionRemoveSeed.c:3
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

Перекрестные ссылки ActionData, ActionBase::ClearInventoryReservationEx(), InventoryLocation::GetSlot(), m_Seed и InventoryLocation::SetHands().