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

◆ CheckIngredientMatch()

bool CheckIngredientMatch ( ItemBase item1,
ItemBase item2 )
protected

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

116 {
117 if (item1 == NULL || item2 == NULL) return false;
118
119 m_Items[0] = item1;
120 m_Items[1] = item2;
121
122 bool found = false;
123 for (int i = 0; i < MAX_NUMBER_OF_INGREDIENTS; i++)//all ingredients
124 {
125 found = false;
126 array<string> tempArray = m_Ingredients[i];
127 for (int x = 0; x < tempArray.Count(); x++)//particular ingredient array
128 {
129 for (int z = 0; z < MAX_NUMBER_OF_INGREDIENTS; z++)
130 {
131 if (m_Items[z] != NULL)
132 {
133 ItemBase item = m_Items[z];
134 if (tempArray.Get(x) == item.GetType() || GetGame().IsKindOf(item.GetType(),tempArray.Get(x)))
135 {
136 found = true;//we found a match
137 //m_IngredientsSorted.Insert(item);
138 m_IngredientsSorted[i] = item;
139 m_Items[z] = NULL;
140 }
141 }
142 if (found) break;//we found a match, no need to check the remaining ingredients
143 }
144 if (found) break;//we found a match, no need to check this m_Ingredient array
145 }
146 if (!found) return false;// no match within an m_Ingredient array, no reason to continue the search, recipe is invalid
147 }
148
149 if (found)
150 {
151 return true;
152 }
153 else
154 {
155 return false;
156 }
157 }
Icon x
ItemBase m_Items[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:28
ref array< string > m_Ingredients[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:24
ItemBase m_IngredientsSorted[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:30
const int MAX_NUMBER_OF_INGREDIENTS
Определения RecipeBase.c:1
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_Ingredients, m_IngredientsSorted, m_Items, MAX_NUMBER_OF_INGREDIENTS и x.