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

◆ CanSwapEntitiesEx()

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

См. определение в файле 3_Game/DayZ/Systems/Inventory/Inventory.c строка 630

631 {
632 int slot;
633 InventoryLocation il1 = new InventoryLocation();
634 InventoryLocation il2 = new InventoryLocation();
635
636 item2.GetInventory().GetCurrentInventoryLocation(il2);
637 slot = il2.GetSlot();
638
639 if (item1.CanBeSplit() && item1.GetQuantity() > item1.GetTargetQuantityMax(slot))
640 return false;
641
642 item1.GetInventory().GetCurrentInventoryLocation(il1);
643 slot = il1.GetSlot();
644
645 if (item2.CanBeSplit() && item2.GetQuantity() > item2.GetTargetQuantityMax(slot))
646 return false;
647
648 if (!item1.CanSwapEntities(item2, il2, il1) || !item2.CanSwapEntities(item1, il1, il2))
649 {
650 return false;
651 }
652
653 return CanSwapEntities(item1,item2);
654 }
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(), EntityAI::PredictiveTakeOrSwapAttachment(), WeaponManager::PrepareInventoryLocationForMagazineSwap(), AttachmentCategoriesRow::Select(), Attachments::Select(), Container::Select(), HandsPreview::Select(), PlayerContainer::Select(), VicinitySlotsContainer::Select(), ZombieContainer::Select(), EntityAI::SwapEntitiesImpl(), HumanInventory::SwappingToPreviousLocation(), ClosableContainer::TakeAsAttachment() и HandsContainer::TakeAsAttachment().