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

◆ CheckBaitCompatibility()

bool CheckBaitCompatibility ( YieldItemBase yItem,
array< ECatchingBaitCategories > excludedTypes = null )
protected

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

175 {
176 float highestSensitivity = 0.0;
177 float sensitivity = 0.0;
178 int count = m_BaitCompatibilityMap.Count();
179 ECatchingBaitCategories baitCategoryType;
180
181 for (int i = 0; i < count; i++)
182 {
183 baitCategoryType = m_BaitCompatibilityMap.GetKey(i);
184 if (excludedTypes && excludedTypes.Find(baitCategoryType) != -1) //skip ignored bait types in the first run
185 continue;
186
187 sensitivity = yItem.GetBaitTypeSensitivity(baitCategoryType);
188 if (sensitivity < 0)
189 {
190 if (m_ExcludedItems.Find(yItem) != -1)
191 m_ExcludedItems.Insert(yItem);
192 return false;
193 }
194
195 highestSensitivity = Math.Max(highestSensitivity,sensitivity);
196 }
197
198 #ifdef DEVELOPER
199 if (IsCLIParam("catchingLogs"))
200 {
201 if (count == 0)
202 Print("dbgTrapz | " + yItem + " compatible due to unspecified bait compatibility!");
203 else if (highestSensitivity > 0.0)
204 Print("dbgTrapz | " + yItem + " compatible with highestSensitivity: " + highestSensitivity);
205 }
206 #endif
207
208 return count == 0 || highestSensitivity > 0.0;
209 }
ref array< YieldItemBase > m_ExcludedItems
Определения CatchingContextBase.c:25
ref map< int, ref BaitData > m_BaitCompatibilityMap
Определения CatchingContextBase.c:23
Определения EnMath.c:7
float GetBaitTypeSensitivity(ECatchingBaitCategories type)
Определения CatchYieldItemBase.c:53
proto void Print(void var)
Prints content of variable to console/log.
static proto float Max(float x, float y)
Returns bigger of two given values.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.

Перекрестные ссылки YieldItemBase::GetBaitTypeSensitivity(), IsCLIParam(), m_BaitCompatibilityMap, m_ExcludedItems, Math::Max() и Print().

Используется в ParseYieldItemsForCompatibility().