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

◆ ActionCondition()

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

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

53 {
54 Object targetObject = target.GetObject();
55 Object targetParent = target.GetParent();
56 if ( !targetParent || !targetParent.IsInherited(TentBase) )
57 return false;
58
59 if ( player && targetObject && targetParent )
60 {
61 array<string> selections = new array<string>;
62 PluginRepairing module_repairing;
63 Class.CastTo(module_repairing, GetPlugin(PluginRepairing));
64 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections, "view");
65 TentBase tent = TentBase.Cast( targetParent );
66
67 string damageZone = "";
68
69 for (int s = 0; s < selections.Count(); s++)
70 {
71 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
72 {
73 //Print("selections[s]: " + selections[s] + " | damageZone: " + damageZone);
74 break;
75 }
76 }
77
78 if ( damageZone != "" )
79 {
80 if (module_repairing.CanRepair(item,tent,damageZone))
81 {
82 m_CurrentDamageZone = damageZone;
83 return true;
84 }
85 }
86 }
87 return false;
88 }
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
string m_CurrentDamageZone
Определения ActionRepairTent.c:22
class LOD Object

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