Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionEnableDamageHandling.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Specific entity to disable damage handling for.")]
5 ref SCR_ScenarioFrameworkGet m_EntityGetter;
6
7 [Attribute(defvalue: "1", desc: "Enable damage handling")]
8 bool m_bEnableDamage;
9
10 [Attribute(desc: "Entity search radius. Any entity in it will have its damage handling disabled.", params: "0 inf 0.01")]
11 float m_fSearchRadius;
12
13 //------------------------------------------------------------------------------------------------
14 override void OnActivate(IEntity object)
15 {
16 if (!CanActivate())
17 return;
18
19 IEntity entity;
20 if (ValidateInputEntity(object, m_EntityGetter, entity))
21 QueryEntity(entity);
22
23 if (m_fSearchRadius > 0)
24 GetGame().GetWorld().QueryEntitiesBySphere(object.GetOrigin(), m_fSearchRadius, QueryEntity);
25 }
26
27 //------------------------------------------------------------------------------------------------
28 protected bool QueryEntity(notnull IEntity ent)
29 {
30 SCR_DamageManagerComponent damageManager = SCR_DamageManagerComponent.Cast(ent.FindComponent(SCR_DamageManagerComponent));
31 if (damageManager)
32 damageManager.EnableDamageHandling(m_bEnableDamage);
33
34 return true;
35 }
36}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
vector GetOrigin()
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_FieldOfViewSettings Attribute