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

◆ CanPerformActionFromInventory()

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

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

1047 {
1048 ItemBase itemInHand = m_Player.GetItemInHands();
1049 ActionTarget target;
1050 target = new ActionTarget(targetItem, null, -1, vector.Zero, -1);
1051 bool hasTarget = targetItem != NULL;
1052
1053 if (mainItem)
1054 {
1055 array<ActionBase_Basic> actions;
1056 ActionBase picked_action;
1057 int i;
1058
1059 //First check single use actions
1060 mainItem.GetActions(DefaultActionInput, actions);
1061 if (actions)
1062 {
1063 for (i = 0; i < actions.Count(); i++)
1064 {
1065 picked_action = ActionBase.Cast(actions[i]);
1066 if (picked_action && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBePerformedFromInventory())
1067 {
1068 if (hasTarget == picked_action.HasTarget())
1069 return true;
1070 }
1071 }
1072 }
1073
1074 //Inventory specific actions
1075 mainItem.GetActions(InventoryOnlyActionInput, actions);
1076 if (actions)
1077 {
1078 for (i = 0; i < actions.Count(); i++)
1079 {
1080 picked_action = ActionBase.Cast(actions[i]);
1081 if (picked_action && picked_action.Can(m_Player,target, itemInHand))
1082 {
1083 if (hasTarget == picked_action.HasTarget())
1084 return true;
1085 }
1086 }
1087 }
1088 }
1089 return false;
1090 }
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:121
class GP5GasMask extends MaskBase ItemBase
DayZPlayer m_Player
Определения Hand_Events.c:42
bool CanBePerformedFromInventory()
Определения ActionBase.c:308
bool HasTarget()
Определения ActionBase.c:244
bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
Определения ActionBase.c:897

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

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