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

◆ ActionCondition()

override bool ActionRepairTentPart::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

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

53 {
54 //m_CurrentDamageZone = "";
55 Object targetObject = target.GetObject();
56 Object targetParent = target.GetParent();
57 if ( !targetParent || !targetParent.IsInherited(TentBase) )
58 return false;
59
60 if ( player && targetObject && targetParent )
61 {
62 array<string> selections = new array<string>;
63 PluginRepairing module_repairing;
64 Class.CastTo(module_repairing, GetPlugin(PluginRepairing));
65 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections, "view");
66 TentBase tent = TentBase.Cast( targetParent );
67 if (m_LastValidType != targetObject.Type() || m_LastValidComponentIndex != target.GetComponentIndex() || m_CurrentDamageZone == "" || m_CurrentDamageZone == "Body")
68 {
69 string damageZone = "";
70
71 for (int s = 0; s < selections.Count(); s++)
72 {
73 if ( DamageSystem.GetDamageZoneFromComponentName(tent, selections[s], damageZone) ) //NOTE: relevant fire geometry and view geometry selection names MUST match in order to get a valid damage zone
74 {
75 //Print("#" + s + " damageZone: " + damageZone);
76 if (tent.GetHealthLevel("" + damageZone) == GameConstants.STATE_RUINED )
77 {
78 m_CurrentDamageZone = damageZone;
79 m_LastValidComponentIndex = target.GetComponentIndex();
80 break;
81 }else
82 continue;
83 }
84 }
85 if ( damageZone != "" && m_CurrentDamageZone != "Body" ) //This may seem like a duplicate but is required to work properly
86 {
87 m_CurrentDamageZone = damageZone;
88 m_LastValidComponentIndex = target.GetComponentIndex();
89 }
90 }
91
92 if ( m_CurrentDamageZone != "" && m_CurrentDamageZone != "Body" && tent.GetHealthLevel("" + damageZone) == GameConstants.STATE_RUINED )
93 {
94 return true;
95 }
96 }
97
98 return false;
99 }
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
int m_LastValidComponentIndex
Определения ActionRepairTentPart.c:23
string m_CurrentDamageZone
Определения ActionRepairTentPart.c:22
class LOD Object

Перекрестные ссылки ActionTarget, Class::CastTo(), GetPlugin(), m_CurrentDamageZone, m_LastValidComponentIndex, m_LastValidType и GameConstants::STATE_RUINED.