DayZ 1.30
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 if (tent.GetHealthLevel("" + damageZone) == GameConstants.STATE_RUINED )
76 {
77 m_CurrentDamageZone = damageZone;
78 m_LastValidComponentIndex = target.GetComponentIndex();
79 break;
80 }else
81 continue;
82 }
83 }
84 if ( damageZone != "" && m_CurrentDamageZone != "Body" ) //This may seem like a duplicate but is required to work properly
85 {
86 m_CurrentDamageZone = damageZone;
87 m_LastValidComponentIndex = target.GetComponentIndex();
88 }
89 }
90
91 if ( m_CurrentDamageZone != "" && m_CurrentDamageZone != "Body" && tent.GetHealthLevel("" + damageZone) == GameConstants.STATE_RUINED )
92 {
93 return true;
94 }
95 }
96
97 return false;
98 }
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:326
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.