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

◆ ActionCondition()

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

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

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

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