670 {
671 if( GetFocusedContainer().IsInherited( ContainerWithCargo ) || GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments ) )
672 {
673 return GetFocusedContainer().Select();
674 }
675 else
676 {
677 SlotsIcon selected_slot = ItemManager.GetInstance().GetSelectedIcon();
679 EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
681 {
682 if( selected_item )
683 {
684 if( selected_item != focused_item)
685 {
686 if( selected_item.GetInventory().CanRemoveEntity() )
687 {
689 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
690 return true;
691 }
692 }
693 }
694 else
695 {
696 if( focused_item && focused_item.GetInventory().CanRemoveEntity() )
697 {
699 if( item_in_hands && item_in_hands.GetInventory().CanRemoveEntity() )
700 {
701 if( GameInventory.CanSwapEntitiesEx( item_in_hands, focused_item ) )
702 {
703 GetGame().
GetPlayer().PredictiveSwapEntities( item_in_hands, focused_item );
704 return true;
705 }
706 else
707 {
708 InventoryLocation il_hands_dst = new InventoryLocation;
710 {
712
715
717 return true;
718 }
719 }
720 }
721 else
722 {
723 if(
GetGame().
GetPlayer().GetHumanInventory().CanAddEntityInHands( focused_item ) )
724 {
726 return true;
727 }
728 }
729 }
730 }
731 }
732 }
733 return false;
734 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
FindInventoryLocationType
flags for searching locations in inventory
proto native DayZPlayer GetPlayer()
override EntityAI GetFocusedItem()
proto native EntityAI GetParent()
returns parent of current inventory location
proto native CGame GetGame()