455 {
457 if (m_am_entity1 == null || m_am_entity2 == null) return;
458
459 if (combinationFlags == InventoryCombinationFlags.NONE) return;
460
461 Weapon_Base wpn;
462 Magazine mag;
463
464 if (combinationFlags & InventoryCombinationFlags.PERFORM_ACTION)
465 {
466 ActionManagerClient amc;
467 Class.CastTo(amc, player.GetActionManager());
468
469 if (m_am_entity1 == player.GetHumanInventory().GetEntityInHands())
470 {
472 }
473 else
474 {
476 }
477 }
478 else if (combinationFlags & InventoryCombinationFlags.SET_ACTION)
479 {
480 ActionManagerClient amc2;
481 Class.CastTo(amc2, player.GetActionManager());
482
483 if (m_am_entity1 == player.GetHumanInventory().GetEntityInHands())
484 {
486 }
487 else
488 {
490 }
491 }
492 else if (combinationFlags & InventoryCombinationFlags.COMBINE_QUANTITY2)
493 {
495 entity.CombineItemsClient(
ItemBase.Cast( m_am_entity2 ));
496 }
497 else if (combinationFlags & InventoryCombinationFlags.ADD_AS_ATTACHMENT)
498 {
499 float stackable = m_am_entity2.GetTargetQuantityMax(-1);
500
501 if (stackable == 0 || stackable >= m_am_entity2.GetQuantity())
502 {
503 player.PredictiveTakeEntityToTargetAttachment(m_am_entity1, m_am_entity2);
504 }
505 else
506 {
507 InventoryLocation il = new InventoryLocation();
509 ItemBase.Cast(m_am_entity2).SplitIntoStackMaxToInventoryLocationClient(il);
510 }
511 }
512 else if (combinationFlags & InventoryCombinationFlags.ADD_AS_CARGO)
513 {
514 SplitItemUtils.TakeOrSplitToInventory(player, m_am_entity1, m_am_entity2);
515 }
516 }
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
void SetActionFromInventory(ItemBase mainItem, ItemBase targetItem)
void PerformActionFromInventory(ItemBase mainItem, ItemBase targetItem)
proto native CGame GetGame()