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

◆ RemoveBleedingSource() [3/3]

bool BleedingSourcesManagerBase::RemoveBleedingSource ( int bit)
inlineprotected

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

44 {
45 if (super.RemoveBleedingSource(bit))
46 {
47 m_Player.OnBleedingSourceRemovedEx(m_Item);
48
49 float chanceToInfect;
50 if (m_Item)
51 {
52 chanceToInfect = m_Item.GetInfectionChance(0, CachedObjectsParams.PARAM1_BOOL);
53 }
54 else
55 {
56 chanceToInfect = PlayerConstants.BLEEDING_SOURCE_CLOSE_INFECTION_CHANCE;
57 }
58 float diceRoll = Math.RandomFloat01();
59 if (diceRoll < chanceToInfect)
60 {
61 m_Player.InsertAgent(eAgents.WOUND_AGENT);
62 }
63 }
64 else
65 {
66 ErrorEx("Failed to remove bleeding source:" + bit,ErrorExSeverity.INFO);
67 }
68
69 int inverse_bit_mask = ~bit;
70 m_Player.SetBleedingBits(m_Player.GetBleedingBits() & inverse_bit_mask);
71 m_Item = null;//reset, so that next call, if induced by self-healing, will have no item
72
73 return true;
74 }
eAgents
Определения EAgents.c:3
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx

Перекрестные ссылки PlayerConstants::BLEEDING_SOURCE_CLOSE_INFECTION_CHANCE, ErrorEx, m_Item, m_Player, CachedObjectsParams::PARAM1_BOOL и Math::RandomFloat01().