DayZ 1.24
Loading...
Searching...
No Matches
RainProcurementManager.c
Go to the documentation of this file.
1
3{
5 protected int m_IsUnderRoof;
7 protected const int RAIN_COEFFICIENT = 10;
8
13
14 // ----------------------------------------------------------------------------------------
16 {
18
19 //m_ProcuringItem.SetQuantity(0); /*set to 0 for debug purposses*/
20
21 if (!m_IsUnderRoof)
22 {
23 m_UpdateTimer = new Timer();
24 m_UpdateTimer.Run(10, this, "RainProcurementCheck", NULL, true);
25 }
26 }
27
28 // ----------------------------------------------------------------------------------------
30 {
31 float rain_intensity = GetGame().GetWeather().GetRain().GetActual();
33
34 if (rain_intensity > 0)
35 {
36 if (m_ProcuringItem.GetQuantity() < m_ProcuringItem.GetQuantityMax())
37 {
39
40 //Print( "Quantity of " + m_ProcuringItem + " is: " + m_ProcuringItem.GetQuantity() );
41 }
42 else
43 {
44 //Print("vesel full");
46 }
47 }
48 }
49
50 // ----------------------------------------------------------------------------------------
51 /*bool IsUnderRoof()
52 {
53 vector minMax[2];
54 m_ProcuringItem.GetCollisionBox(minMax);
55
56 vector size = Vector(0,0,0);
57 size[1] = minMax[1][1] - minMax[0][1];
58
59 vector from = m_ProcuringItem.GetPosition() + size;
60 vector ceiling = "0 20 0";
61 vector to = from + ceiling;
62 vector contact_pos;
63 vector contact_dir;
64
65 int contact_component;
66
67 return DayZPhysics.RaycastRV( from, to, contact_pos, contact_dir, contact_component, NULL, NULL, m_ProcuringItem );
68 }*/
69
70 // ----------------------------------------------------------------------------------------
71 bool IsRunning()
72 {
73 return m_UpdateTimer != null;
74 }
75
77 {
78 if (!m_IsUnderRoof)
79 m_UpdateTimer.Stop();
80
81 }
82};
Definition Liquid.c:2
static void FillContainerEnviro(ItemBase container, int liquid_type, float amount, bool inject_agents=false)
Definition Liquid.c:126
DEPRECATED, done through the RainProcurementHandler / component instead.
void RainProcurementManager(ItemBase procuring_item)
proto native CGame GetGame()
const int LIQUID_WATER
Definition constants.c:504