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

◆ OnPerformCombination()

void HandsContainer::OnPerformCombination ( int combinationFlags)
inlineprotected

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

626 {
627 PlayerBase m_player = PlayerBase.Cast( GetGame().GetPlayer() );
628 if ( m_am_entity1 == null || m_am_entity2 == null ) return;
629
630 if ( combinationFlags == InventoryCombinationFlags.NONE ) return;
631
632 if ( combinationFlags & InventoryCombinationFlags.LOAD_CHAMBER )
633 {
634 Magazine mag;
635 if ( Class.CastTo(mag, m_am_entity2 ) )
636 {
638 return;
639 }
640 }
641
642 if ( combinationFlags & InventoryCombinationFlags.ADD_AS_ATTACHMENT )
643 {
644 if( m_Atts )
645 {
646 m_Body.RemoveItem( m_Atts.GetWrapper() );
647 delete m_Atts;
648 }
649 if( m_am_entity2.GetSlotsCountCorrect() > 0 )
650 {
651 m_Atts = new Attachments( this, m_am_entity2 );
652 m_Atts.InitAttachmentGrid( 1 );
653
654 }
655
656 Refresh();
657 m_Parent.Refresh();
658
659 Weapon_Base wpn1;
660 Magazine mag1;
661 if ( Class.CastTo(wpn1, m_am_entity1 ) && Class.CastTo(mag1, m_am_entity2 ) )
662 {
664 {
666 return;
667 }
668 }
669
670 SplitItemUtils.TakeOrSplitToInventory(m_player, m_am_entity1, m_am_entity2);
671 //m_player.PredictiveTakeEntityToTargetAttachment( m_am_entity1, m_am_entity2 );
672 }
673
674 if ( combinationFlags & InventoryCombinationFlags.ADD_AS_CARGO )
675 {
676 m_player.PredictiveTakeEntityToTargetCargo( m_am_entity1, m_am_entity2 );
677 }
678
679 if ( combinationFlags & InventoryCombinationFlags.SWAP )
680 {
681 Magazine swapmag1;
682 Magazine swapmag2;
683 if (Class.CastTo(swapmag1, m_am_entity1) && Class.CastTo(swapmag2, m_am_entity2 ) )
684 {
685 if( m_player.GetWeaponManager().CanSwapMagazine( Weapon_Base.Cast( swapmag1.GetParent() ), Magazine.Cast( swapmag2 ) ) )
686 {
688 return;
689 }
690
691 if( m_player.GetWeaponManager().CanSwapMagazine(Weapon_Base.Cast( swapmag2.GetParent() ), Magazine.Cast( swapmag1 )) )
692 {
694 return;
695 }
696 }
697 if ( !m_player.PredictiveSwapEntities( m_am_entity1, m_am_entity2 ) && m_player.GetHumanInventory().CanAddEntityInHands( m_am_entity1 ) )
698 {
699 m_player.PredictiveTakeEntityToHands( m_am_entity1 );
700 }
701 }
702
703 if ( combinationFlags & InventoryCombinationFlags.TAKE_TO_HANDS )
704 {
705 if ( m_Atts )
706 {
707 m_Body.RemoveItem( m_Atts.GetWrapper() );
708 delete m_Atts;
709 }
710
711 if ( m_am_entity2.GetSlotsCountCorrect() > 0 )
712 {
713 m_Atts = new Attachments( this, m_am_entity2 );
714 m_Atts.InitAttachmentGrid( 1 );
715
716 }
717 Refresh();
718 m_Parent.Refresh();
719
720 if ( m_player.GetHumanInventory().CanAddEntityInHands( m_am_entity2 ) )
721 {
722 m_player.PredictiveTakeEntityToHands( m_am_entity2 );
723 }
724 }
725 }
PlayerBase GetPlayer()
Определения ModifierBase.c:51
DayZPlayer m_player
Определения RandomGeneratorSyncManager.c:16
Widget m_Parent
Определения SizeToChild.c:92
WeaponManager GetWeaponManager()
Определения DayZPlayerImplement.c:978
ref Attachments m_Atts
Определения HandsContainer.c:7
override void Refresh()
Определения HandsContainer.c:324
bool CanAttachMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
Определения WeaponManager.c:91
bool AttachMagazine(Magazine mag, ActionBase control_action=NULL)
Определения WeaponManager.c:397
bool LoadBullet(Magazine mag, ActionBase control_action=NULL)
Определения WeaponManager.c:422
bool CanSwapMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
Определения WeaponManager.c:132
bool SwapMagazine(Magazine mag, ActionBase control_action=NULL)
Определения WeaponManager.c:407
proto native CGame GetGame()

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, Class::CastTo(), GetGame(), GetPlayer(), InventoryCombinationFlags::LOAD_CHAMBER, m_Atts, m_Parent, m_player, InventoryCombinationFlags::NONE, Refresh(), InventoryCombinationFlags::SWAP, InventoryCombinationFlags::TAKE_TO_HANDS и SplitItemUtils::TakeOrSplitToInventory().