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

◆ CalculateQuantity()

override void BroomBase::CalculateQuantity ( )
inlineprivate

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

53 {
54 if (GetGame().IsServer())
55 {
56 float currentHealth01 = GetHealth01();
57 float currentEnergy01 = GetCompEM().GetEnergy0To1();
58
59 //Health needs to copy internal energy, but only if that means it will be going down from its current value(the item can't heal itself after obtaining damage just because it has full internal energy)
60 SetHealth01("","",Math.Min(currentHealth01,currentEnergy01));
61 //Energy needs to copy health, but only if it is higher(in 01 terms) than health, that means if an item with full energy gets damaged and lit, the internal energy needs to be adjusted to follow the health. Situations where internal energy is lower than health are handled on the line above
62 GetCompEM().SetEnergy0To1(GetHealth01());
63 }
64 }
proto native CGame GetGame()

Перекрестные ссылки GetGame() и Math::Min().

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