Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
FireDamageSystem.c
Go to the documentation of this file.
2 {
3  protected ref array<SCR_DamageManagerComponent> m_aDamageManagers = {};
4 
5  //------------------------------------------------------------------------------------------------
6  override bool ShouldBePaused()
7  {
8  return true;
9  }
10 
11  //------------------------------------------------------------------------------------------------
12  protected override void OnUpdate(ESystemPoint point)
13  {
14  float timeSlice = GetWorld().GetFixedTimeSlice();
15 
16  foreach (SCR_DamageManagerComponent component : m_aDamageManagers)
17  {
18  if (component)
19  component.UpdateFireDamage(timeSlice);
20  }
21  }
22 
23  //------------------------------------------------------------------------------------------------
24  override void OnDiag(float timeSlice)
25  {
26  DbgUI.Begin("FireDamageSystem");
27 
28  DbgUI.Text("Damage managers: " + m_aDamageManagers.Count());
29 
30  if (DbgUI.Button("Dump active fire damage manager components"))
31  {
32  foreach (SCR_DamageManagerComponent component : m_aDamageManagers)
33  {
34  Print(component.GetOwner(), LogLevel.ERROR);
35  }
36  }
37 
38  DbgUI.End();
39  }
40 
41  //------------------------------------------------------------------------------------------------
43  void Register(SCR_DamageManagerComponent component)
44  {
45  //About to be deleted
46  if (component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() & EntityFlags.USER5))
47  return;
48 
49  if (!m_aDamageManagers.Contains(component))
50  m_aDamageManagers.Insert(component);
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  void Unregister(SCR_DamageManagerComponent component)
55  {
56  m_aDamageManagers.RemoveItem(component);
57 
58  // Final update
59  if (component)
60  component.UpdateFireDamage(GetWorld().GetFixedTimeSlice());
61  }
62 }
FireDamageSystem
Definition: FireDamageSystem.c:1
GameSystem
Definition: GameSystem.c:12