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

◆ ActionCondition()

override bool ActionRepairMotorbikeChassis::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprotected

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

23 {
24 Motorbike motorbike = Motorbike.Cast(target.GetObject());
25 if (!motorbike)
26 return false;
27
28 if (g_Game.IsMultiplayer() && g_Game.IsServer())
29 return true;
30
31 if (m_LastValidComponentIndex != target.GetComponentIndex() || m_CurrentDamageZone != "Engine")
32 {
33 array<string> selections = new array<string>();
34 motorbike.GetActionComponentNameList(target.GetComponentIndex(), selections);
35
36 foreach (string selection : selections)
37 {
38 string damageZone = "";
39 if (motorbike && DamageSystem.GetDamageZoneFromComponentName(motorbike, selection, damageZone))
40 {
41 int zoneHP = motorbike.GetHealthLevel(damageZone);
42 if (zoneHP > GameConstants.STATE_WORN && zoneHP < GameConstants.STATE_RUINED)
43 {
44 m_CurrentDamageZone = damageZone;
45 m_LastValidComponentIndex = target.GetComponentIndex();
46
47 return true;
48 }
49 }
50 }
51 }
52
53 return false;
54 }
DayZGame g_Game
Определения DayZGame.c:4074

Перекрестные ссылки ActionTarget(), g_Game, ActionRepairVehiclePartBase::m_CurrentDamageZone, m_LastValidComponentIndex, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.