598 {
599 ItemManager.GetInstance().HideDropzones();
600 ItemManager.GetInstance().SetIsDragging( false );
601 SlotsIcon slots_icon;
603 int slot_id = -1;
604 bool is_reserved = false;
606 receiver.GetUserData(slots_icon);
607
608
609
610
611 if( slots_icon )
612 {
617 }
618
620 if( !item )
621 {
622 return;
623 }
625 InventoryLocation il = new InventoryLocation;
626 float stackable;
627
629 if( !item.GetInventory().CanRemoveEntity() || !player.CanManipulateInventory() )
630 return;
631
633 Weapon_Base wpn;
634 Magazine mag;
635 if( Class.CastTo(wpn,
m_Entity ) && Class.CastTo(mag, item ) )
636 {
637 if( player.GetWeaponManager().CanAttachMagazine( wpn, mag ) )
638 {
639 player.GetWeaponManager().AttachMagazine( mag );
640 }
641 }
642 else if( receiver_item && !is_reserved )
643 {
644 if( (
ItemBase.Cast( receiver_item ) ).CanBeCombined(
ItemBase.Cast( item ) ) )
645 {
646 (
ItemBase.Cast( receiver_item ) ).CombineItemsClient(
ItemBase.Cast( item ) );
647 }
648 else if( GameInventory.CanSwapEntitiesEx( receiver_item, item ) )
649 {
650 if( !receiver_item.GetInventory().CanRemoveEntity() )
651 return;
653 }
654 else if( receiver_item.GetInventory().CanAddAttachment( item ) )
655 {
656 player.PredictiveTakeEntityToTargetAttachment(receiver_item, item);
657 }
658 }
659 else if( attached_entity && attached_entity.GetInventory().CanAddAttachmentEx( item, slot_id ) )
660 {
661 player.PredictiveTakeEntityToTargetAttachmentEx(attached_entity, item, slot_id);
662 }
663 else if(attached_entity && attached_entity.GetInventory().CanAddAttachment(item))
664 {
666 player.PredictiveTakeEntityToTargetAttachmentEx(attached_entity, item, il.
GetSlot());
667 }
668 else if(
m_Entity.GetInventory().CanAddAttachment(item) )
669 {
671 player.PredictiveTakeEntityToTargetAttachmentEx(
m_Entity, item, il.
GetSlot());
672 }
673 else if(
m_Entity.GetInventory().CanAddEntityInCargo( item, item.GetInventory().GetFlipCargo() ) && !
m_Entity.GetInventory().HasEntityInCargo( item ) )
674 {
676 }
677
678
679
680
681 }
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
proto native DayZPlayer GetPlayer()
EntityAI GetItemPreviewItem(Widget w)
proto native int GetSlot()
returns slot id if current type is Attachment
proto native CGame GetGame()