853 {
855 EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
857
858
859 if( focused_item != selected_item )
860 {
861 if( selected_item )
862 {
863 if( selected_item.GetInventory().CanRemoveEntity() &&
m_Entity )
864 {
865 bool can_add =
m_Entity.GetInventory().CanAddEntityInCargo( selected_item, selected_item.GetInventory().GetFlipCargo());
866 bool in_cargo = !player.GetInventory().HasEntityInInventory( selected_item ) || !
m_Entity.GetInventory().HasEntityInCargo( selected_item );
867 if( can_add && in_cargo )
868 {
869 player.PredictiveTakeEntityToTargetCargo(
m_Entity, selected_item );
870 Container selected_cont2 = ItemManager.GetInstance().GetSelectedContainer();
871 if( selected_cont2 )
872 {
874 }
875
878 return true;
879 }
880 else
881 {
882 Container selected_cont = ItemManager.GetInstance().GetSelectedContainer();
883 if( selected_cont )
884 {
886 }
887
890 }
891 }
892 }
893 else if ( focused_item && focused_item.GetInventory().CanRemoveEntity() )
894 {
896 if( item_in_hands )
897 {
898 if( GameInventory.CanSwapEntitiesEx( item_in_hands, focused_item ) )
899 {
900 player.PredictiveSwapEntities( item_in_hands, focused_item );
901 return true;
902 }
903 }
904 else
905 {
906 if( player.GetHumanInventory().CanAddEntityInHands( focused_item ) )
907 {
908 player.PredictiveTakeEntityToHands( focused_item );
909 return true;
910 }
911 }
912 }
913 }
914 return false;
915 }
proto native DayZPlayer GetPlayer()
override void SetActive(bool active)
override EntityAI GetFocusedItem()
int m_FocusedItemPosition
override void SetDefaultFocus(bool while_micromanagment_mode=false)
proto native CGame GetGame()