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

◆ CanPerformActionFromInventory()

bool ActionManagerClient::CanPerformActionFromInventory ( ItemBase mainItem,
ItemBase targetItem )
inlineprotected

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

1102 {
1103 ItemBase itemInHand = m_Player.GetItemInHands();
1104 ActionTarget target;
1105 target = new ActionTarget(targetItem, null, -1, vector.Zero, -1);
1106 bool hasTarget = targetItem != NULL;
1107
1108 if (mainItem)
1109 {
1110 array<ActionBase_Basic> actions;
1111 ActionBase picked_action;
1112 int i;
1113
1114 //First check single use actions
1115 mainItem.GetActions(DefaultActionInput, actions);
1116 if (actions)
1117 {
1118 for (i = 0; i < actions.Count(); i++)
1119 {
1120 picked_action = ActionBase.Cast(actions[i]);
1121 if (picked_action && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBePerformedFromInventory())
1122 {
1123 if (hasTarget == picked_action.HasTarget())
1124 return true;
1125 }
1126 }
1127 }
1128
1129 //Inventory specific actions
1130 mainItem.GetActions(InventoryOnlyActionInput, actions);
1131 if (actions)
1132 {
1133 for (i = 0; i < actions.Count(); i++)
1134 {
1135 picked_action = ActionBase.Cast(actions[i]);
1136 if (picked_action && picked_action.Can(m_Player,target, itemInHand))
1137 {
1138 if (hasTarget == picked_action.HasTarget())
1139 return true;
1140 }
1141 }
1142 }
1143 }
1144 return false;
1145 }
void ActionBase()
Определения ActionBase.c:82
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:125
class GP5GasMask extends MaskBase ItemBase
DayZPlayer m_Player
Определения Hand_Events.c:42

Перекрестные ссылки ActionBase(), ActionTarget(), m_Player и vector::Zero.

Используется в Attachments::CanCombineAmmo(), Container::CanCombineAmmo(), VicinitySlotsContainer::CanCombineAmmo(), ItemManager::GetChosenCombinationFlag() и ItemManager::GetCombinationFlags().