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

◆ SetActionFromInventory()

void ActionManagerClient::SetActionFromInventory ( ItemBase mainItem,
ItemBase targetItem )
inlineprotected

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

1225 {
1226 ItemBase itemInHand = m_Player.GetItemInHands();
1227 ActionTarget target;
1228 target = new ActionTarget(targetItem, null, -1, vector.Zero, -1);
1229 bool hasTarget = targetItem != NULL;
1230
1231 if (mainItem)
1232 {
1233 array<ActionBase_Basic> actions;
1234 ActionBase picked_action;
1235
1236 //First check single use actions
1237 mainItem.GetActions(DefaultActionInput, actions);
1238 if (actions)
1239 {
1240 for (int i = 0; i < actions.Count(); i++)
1241 {
1242 picked_action = ActionBase.Cast(actions[i]);
1243 if (picked_action && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBeSetFromInventory())
1244 {
1245 if (hasTarget == picked_action.HasTarget())
1246 {
1247 SetInventoryAction(picked_action, target, itemInHand);
1248 return;
1249 }
1250 }
1251 }
1252 }
1253 //second continuous actions
1254 mainItem.GetActions(ContinuousDefaultActionInput, actions);
1255 if (actions)
1256 {
1257 for (int j = 0; j < actions.Count(); j++)
1258 {
1259 picked_action = ActionBase.Cast(actions[j]);
1260 if (picked_action && picked_action.HasTarget() && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBeSetFromInventory())
1261 {
1262 if (hasTarget == picked_action.HasTarget())
1263 {
1264 SetInventoryAction(picked_action, target, itemInHand);
1265 return;
1266 }
1267 }
1268 }
1269 }
1270 }
1271 }
void ContinuousDefaultActionInput(PlayerBase player)
Определения ActionInput.c:607
class ActionTargets ActionTarget
class GP5GasMask extends MaskBase ItemBase
DayZPlayer m_Player
Определения Hand_Events.c:42
bool HasTarget()
Определения ActionBase.c:244
bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
Определения ActionBase.c:861
bool CanBeSetFromInventory()
Определения ActionBase.c:313
void SetInventoryAction(ActionBase action_name, ItemBase target_item, ItemBase main_item)
Определения ActionManagerClient.c:788

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

Используется в Icon::OnPerformCombination() и Icon::PerformCombination().