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

◆ InventoryReservation()

override bool ActionTakeArrow::InventoryReservation ( ActionData action_data)
inlineprivate

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

56 {
57 bool success = true;
58
59 InventoryLocation il = new InventoryLocation();
60
61 EntityAI targetEntity;
62 if (EntityAI.CastTo(targetEntity, action_data.m_Target.GetObject()))
63 {
64 ArrowManagerBase arrowManager = targetEntity.GetArrowManager();
65 if (arrowManager)
66 {
67 ItemBase targetArrow = ItemBase.Cast(arrowManager.GetFirstArrow());
68 if (targetArrow)
69 {
70 action_data.m_Player.GetInventory().FindFreeLocationFor(targetArrow , FindInventoryLocationType.ANY, il);
71 if (action_data.m_Player.GetInventory().HasInventoryReservation(targetArrow, il))
72 {
73 success = false;
74 }
75 else
76 {
77 action_data.m_Player.GetInventory().AddInventoryReservationEx(targetArrow, il, GameInventory.c_InventoryReservationTimeoutMS);
78 }
79 }
80 }
81 }
82
83 if (success)
84 {
85 if (il)
86 action_data.m_ReservedInventoryLocations.Insert(il);
87 }
88
89 return success;
90 }
class LogManager EntityAI
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
EntityAI GetFirstArrow()
Определения ArrowManagerBase.c:82

Перекрестные ссылки ActionData, GameInventory::c_InventoryReservationTimeoutMS и ArrowManagerBase::GetFirstArrow().