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

◆ ActionCondition()

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

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

46 {
47 ItemBase targetIB = ItemBase.Cast(target.GetObject());
48
49 //Prevent plugging to items in inventory
50 if (targetIB && targetIB.GetHierarchyRoot() == targetIB && item && targetIB.HasEnergyManager() && item.HasEnergyManager())
51 {
52 if (!targetIB.GetCompEM().IsPlugged() && item.GetCompEM().CanReceivePlugFrom(targetIB))
53 {
54 //hotfix, re-work entire action!
55 return targetIB.IsElectricAppliance();
56 }
57
58 // Special case for vehicle batteries
59 if (item.IsInherited(VehicleBattery))
60 {
61 MetalWire metalWire = MetalWire.Cast(item.GetCompEM().GetPluggedDevice());
62
63 if (metalWire && metalWire.GetCompEM().CanReceivePlugFrom(targetIB))
64 {
65 return true; // We can power the action_data.m_Target from vehicle battery because it has metal wire attached.
66 }
67 }
68 }
69
70 return false;
71 }
class GP5GasMask extends MaskBase ItemBase
override bool IsElectricAppliance()
Определения BatteryCharger.c:43

Перекрестные ссылки ActionTarget и ItemBase::IsElectricAppliance().