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

◆ UpdateUsedBait()

void CatchingContextTrapsBase::UpdateUsedBait ( ECatchingBaitCategories type)
inlineprotected

if non-empty bait type is used, some 'Bait' attachment is picked as an active bait (currently no direct link between item and sensitivity-weighted target probability)

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

156 {
157 m_Bait = null;
158 if (type != ECatchingBaitCategories.BAIT_TYPE_EMPTY)
159 {
160 BaitData dta = m_BaitCompatibilityMap.Get(type);
161 if (dta)
162 {
163 ItemBase potentialBait = ItemBase.Cast(dta.m_Owner);
164 if (potentialBait != m_MainItem)
165 m_Bait = potentialBait;
166 }
167 else
168 ErrorEx("failed to acquire BaitData from type: " + type);
169 }
170
171 #ifdef DEVELOPER
172 if (IsCLIParam("catchingLogs"))
173 {
174 if (m_Bait)
175 Print("dbgTrapz | UpdateUsedBait to: " + m_Bait + " | with base bait probability used: " + m_BaitCompatibilityMap.Get(type).m_BaseProbability);
176 else
177 Print("dbgTrapz | UpdateUsedBait to 'null'!");
178 }
179 #endif
180 }
ref map< int, ref BaitData > m_BaitCompatibilityMap
Определения CatchingContextBase.c:23
class BaitData m_MainItem
Определения ActionBase.c:36
class GP5GasMask extends MaskBase ItemBase
EntityAI m_Owner
Определения CatchingContextBase.c:4
ItemBase m_Bait
Определения CatchingContextTraps.c:9
proto void Print(void var)
Prints content of variable to console/log.
enum ShapeType ErrorEx
proto native bool IsCLIParam(string param)
Returns if command line argument is present.

Перекрестные ссылки ErrorEx, IsCLIParam(), m_Bait, m_BaitCompatibilityMap, m_MainItem, BaitData::m_Owner и Print().

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