237 {
240 ItemBase selected_item =
ItemBase.Cast( player.GetHumanInventory().GetEntityInHands() );
241 SlotsIcon focused_icon = GetFocusedSlotsIcon();
242
243 if( selected_item )
244 {
246 int stack_max;
247 if( selected_item && selected_item.GetInventory().CanRemoveEntity() && (focused_icon && !focused_icon.
IsOutOfReach()) )
248 {
249 if(
m_Entity.GetInventory().CanAddAttachmentEx( selected_item, selected_slot ) )
250 {
251 stack_max = InventorySlots.GetStackMaxForSlotId( selected_slot );
252 float quantity = selected_item.GetQuantity();
253 if( stack_max == 0 || stack_max >= quantity || !selected_item.
CanBeSplit() )
254 {
255 return true;
256 }
257 else
258 {
259 return true;
260 }
261 }
262 else if( selected_slot != -1 )
263 {
264 if( prev_item )
265 {
266 InventoryLocation inv_loc = new InventoryLocation;
267 prev_item.GetInventory().GetCurrentInventoryLocation( inv_loc );
268 stack_max = InventorySlots.GetStackMaxForSlotId( inv_loc.
GetSlot() );
269 quantity = prev_item.GetQuantity();
271 {
272 return true;
273 }
274 }
275 }
276 }
277 }
278 return false;
279 }
class GP5GasMask extends MaskBase ItemBase
proto native DayZPlayer GetPlayer()
proto native int GetSlot()
returns slot id if current type is Attachment
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool CanBeSplit()
proto native CGame GetGame()