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

◆ ActionCondition()

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

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

16 {
17 if (player.IsPlacingLocal())
18 return false;
19
20 ItemBase targetIB = ItemBase.Cast(target.GetObject());
21
22 //Prevent plugging to items in inventory
23 if (targetIB && targetIB.GetHierarchyRoot() == targetIB && item)
24 {
25 if (item.HasEnergyManager() && !item.GetCompEM().IsPlugged() && targetIB.HasEnergyManager() && targetIB.GetCompEM().CanReceivePlugFrom(item))
26 {
27 return true;
28 }
29
30 ItemBase attachedDevice = GetAttachedDevice(targetIB);
31 //Will only ever affect batteries
32 if (attachedDevice)
33 {
34 return attachedDevice.GetCompEM().HasFreeSocket();
35 }
36 }
37
38 return false;
39 }
class GP5GasMask extends MaskBase ItemBase
ItemBase GetAttachedDevice(ItemBase parent)
Определения ActionPlugIn.c:87

Перекрестные ссылки ActionTarget и GetAttachedDevice().