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

◆ InventoryReservation()

override bool ActionTakeHybridAttachment::InventoryReservation ( ActionData action_data)
inlineprivate

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

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

Перекрестные ссылки ActionData и GameInventory::c_InventoryReservationTimeoutMS.