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