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

◆ RemoveBleedingSource() [3/3]

bool BleedingSourcesManagerBase::RemoveBleedingSource ( int bit)
inlineprotected

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

38 {
39 if(!super.RemoveBleedingSource(bit))
40 {
41 Error("Failed to remove bleeding source:" + bit);
42 }
43 else
44 {
45 m_Player.OnBleedingSourceRemovedEx(m_Item);
46 }
47
48 int inverse_bit_mask = ~bit;
49 m_Player.SetBleedingBits(m_Player.GetBleedingBits() & inverse_bit_mask );
50
51
52 //infection moved here to allow proper working in singleplayer
53 float chanceToInfect;
54
55 if (m_Item)
56 {
57 chanceToInfect = m_Item.GetInfectionChance(0, CachedObjectsParams.PARAM1_BOOL);
58 }
59 else
60 {
61 chanceToInfect = PlayerConstants.BLEEDING_SOURCE_CLOSE_INFECTION_CHANCE;
62 }
63 float diceRoll = Math.RandomFloat01();
64 if (diceRoll < chanceToInfect)
65 {
66 m_Player.InsertAgent(eAgents.WOUND_AGENT);
67 }
68
69 m_Item = null;//reset, so that next call, if induced by self-healing, will have no item
70
71 return true;
72 }
eAgents
Определения EAgents.c:3
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

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