DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
UniversalTemperatureSourceLambdaFireplace.c
Go to the documentation of this file.
2{
7
9 {
10 m_FuelCount = 0;
13 m_Temperature = 0;
14 }
15
17 {
19 }
20
22 {
24 }
25
26 void SetFuelCount(int value)
27 {
28 m_FuelCount = value;
29 }
30
31 void SetCurrentTemperature(float temperature)
32 {
33 //no fuel present, temperature should be low but there can be high temperature from previous fuel burning
34 if (m_FuelCount == 0 || temperature <= m_SmallFireplaceTemperatureMax)
35 {
36 temperature = Math.Clamp(temperature, 0, m_SmallFireplaceTemperatureMax); //small fire
37 }
38 else
39 {
40 temperature = Math.Clamp(temperature, 0, m_NormalFireplaceTemperatureMax); //normal fire
41 }
42
43 m_Temperature = temperature;
44 }
45
46 override void Execute(UniversalTemperatureSourceSettings pSettings, UniversalTemperatureSourceResult resultValues)
47 {
48 resultValues.m_Temperature = m_Temperature;
49 //Debug.Log(string.Format("Execute: temperature: %1", resultValues.m_Temperature), "UTS Fireplace");
50
51 if (pSettings.m_AffectStat)
52 {
54 pSettings.m_Parent.SetTemperature(m_Temperature);
55 }
56
57 DryItemsInVicinity(pSettings);
58 }
59}
Definition EnMath.c:7
override void DryItemsInVicinity(UniversalTemperatureSourceSettings pSettings)
override void Execute(UniversalTemperatureSourceSettings pSettings, UniversalTemperatureSourceResult resultValues)
bool m_AffectStat
update is called manually (ex. own tick of parent entity)
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.