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

◆ VerifyItemTypeBySlotType()

override void ReplaceItemWithNewLambda::VerifyItemTypeBySlotType ( )
inlineprivate

if attaching from att.slot to att.slot, skips the change to "ground" version. Allows for correct property transfers.

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

47 {
48 if (m_NewLocation.GetType() == InventoryLocationType.ATTACHMENT && m_OldItem.ConfigIsExisting("ChangeIntoOnAttach"))
49 {
50 string str;
51 int idx = -1;
52 TStringArray inventory_slots = new TStringArray;
53 TIntArray inventory_slots_idx = new TIntArray;
54 TStringArray attach_types = new TStringArray;
55
56 m_OldItem.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
57 if (inventory_slots.Count() < 1) //is string
58 {
59 inventory_slots_idx.Insert(InventorySlots.GetSlotIdFromString(m_OldItem.ConfigGetString("ChangeInventorySlot")));
60 attach_types.Insert(m_OldItem.ConfigGetString("ChangeIntoOnAttach"));
61 }
62 else //is array
63 {
64 inventory_slots_idx.Clear();
65 for (int i = 0; i < inventory_slots.Count(); ++i)
66 {
67 inventory_slots_idx.Insert(InventorySlots.GetSlotIdFromString(inventory_slots.Get(i)));
68 }
69 m_OldItem.ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
70 }
71
72 idx = m_NewLocation.GetSlot();
73 str = attach_types.Get(inventory_slots_idx.Find(idx));
74 if (str != "")
75 {
76 m_NewItemType = str;
77 }
78 }
79 }
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
ref InventoryLocation m_NewLocation
Определения ReplaceItemWithNewLambdaBase.c:9
array< string > TStringArray
Определения EnScript.c:685
array< int > TIntArray
Определения EnScript.c:687

Перекрестные ссылки InventorySlots::GetSlotIdFromString(), ReplaceItemWithNewLambdaBase::m_NewItemType, ReplaceItemWithNewLambdaBase::m_NewLocation и ReplaceItemWithNewLambdaBase::m_OldItem.