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

◆ CanSwapEntitiesEx()

static bool GameInventory::CanSwapEntitiesEx ( notnull EntityAI item1,
notnull EntityAI item2 )
inlinestaticprotected

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

629 {
630 int slot;
631 InventoryLocation il1 = new InventoryLocation();
632 InventoryLocation il2 = new InventoryLocation();
633
634 item2.GetInventory().GetCurrentInventoryLocation(il2);
635 slot = il2.GetSlot();
636
637 if (item1.CanBeSplit() && item1.GetQuantity() > item1.GetTargetQuantityMax(slot))
638 return false;
639
640 item1.GetInventory().GetCurrentInventoryLocation(il1);
641 slot = il1.GetSlot();
642
643 if (item2.CanBeSplit() && item2.GetQuantity() > item2.GetTargetQuantityMax(slot))
644 return false;
645
646 if (!item1.CanSwapEntities(item2, il2, il1) || !item2.CanSwapEntities(item1, il1, il2))
647 {
648 return false;
649 }
650
651 return CanSwapEntities(item1,item2);
652 }
static proto native bool CanSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
test if ordinary swap can be performed.
proto native int GetSlot()
returns slot id if current type is Attachment

Перекрестные ссылки CanSwapEntities() и InventoryLocation::GetSlot().

Используется в WeaponManager::CanSwapMagazine(), LayoutHolder::CanSwapOrTakeToHandsEx(), AttachmentCategoriesRow::Combine(), PlayerContainer::DraggingOver(), AttachmentCategoriesRow::DraggingOverHeader(), ClosableContainer::DraggingOverHeader(), HandsContainer::DraggingOverHeader(), VicinityContainer::DraggingOverIcon(), ItemManager::GetChosenCombinationFlag(), HandsContainer::GetCombinationFlags(), InventoryGridController::GetQuickbarItemColor(), HandGuardBase::GuardCondition(), PlayerContainer::OnDropReceivedFromGhostArea(), AttachmentCategoriesRow::OnDropReceivedFromHeader(), VicinityContainer::OnDropReceivedFromIcon(), ManBase::OnQuickBarSingleUse(), WeaponManager::PrepareInventoryLocationForMagazineSwap(), AttachmentCategoriesRow::Select(), Attachments::Select(), Container::Select(), HandsPreview::Select(), PlayerContainer::Select(), VicinitySlotsContainer::Select(), ZombieContainer::Select(), EntityAI::SwapEntitiesImpl(), HumanInventory::SwappingToPreviousLocation(), ClosableContainer::TakeAsAttachment() и HandsContainer::TakeAsAttachment().