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

◆ InjectAgentsWithPlayer()

void PluginBase::InjectAgentsWithPlayer ( EntityAI target,
int agents,
float protection,
int dose_size,
int inject_type )
inlineprotected

will add agents to a given target, using chance of transmission and full dose size if chance succeeds

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

305 {
306 if(target && (agents != 0) && target.IsEntityAI() )
307 {
308 int bit_count = Math.GetNumberOfSetBits(agents);
309
310 for (int i = 0; i < bit_count; i++)
311 {
312 int agent_bit = Math.Pow(2,Math.GetNthBitSet(agents,i));
313 if( DetermineChanceToTransmit(agent_bit, protection, inject_type))
314 {
315 target.InsertAgent(agent_bit,dose_size);
316 }
317 }
318 }
319 }
bool DetermineChanceToTransmit(int agent_id, float protection, int inject_type)
Определения PluginTransmissionAgents.c:412

Перекрестные ссылки DetermineChanceToTransmit(), Math::GetNthBitSet(), Math::GetNumberOfSetBits() и Math::Pow().

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