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

◆ ReduceAgent()

void PlayerAgentPool::ReduceAgent ( int id,
float percent )
inlineprotected

Reduce count of specified agent by a given percentage from Agent Pool.

Аргументы
agent_idId of agent (see eAgents enum)
percentHow many percents of the agents should be reduced

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

232 {
233 percent = Math.Clamp(percent, 0, 100);
234 float reduction = percent * 0.01;
235
236 int agentCount = GetSingleAgentCount(id);
237 agentCount -= agentCount * reduction;
238
239 SetAgentCount(id, agentCount);
240 }
void SetAgentCount(int agent_id, float count)
Directly set the count of agents for give id in pool.
Определения PlayerAgentPool.c:297
int GetSingleAgentCount(int agent_id)
Number of agents of specified id.
Определения PlayerAgentPool.c:254

Перекрестные ссылки Math::Clamp(), GetSingleAgentCount() и SetAgentCount().