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

◆ ActionCondition()

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

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

56 {
57 ItemBase target_item = ItemBase.Cast(target.GetObject());
58
59 if ( target_item && item )
60 {
61 bool can_drain = Liquid.CanTransfer(target_item,item);
62 bool can_pour = Liquid.CanTransfer(item,target_item);
63
64 if (can_drain && can_pour)
65 {
66 return true;
67 }
68 else if (!can_pour && can_drain)
69 {
70 if ( (!GetGame().IsDedicatedServer()) && !player.GetLiquidTendencyDrain() )
71 {
72 player.SetLiquidTendencyDrain(true);
73 return false;
74 }
75 else
76 {
77 return true;
78 }
79 }
80 else if (!can_drain && can_pour)
81 {
82 if ( (!GetGame().IsDedicatedServer()) && player.GetLiquidTendencyDrain() )
83 {
84 player.SetLiquidTendencyDrain(false);
85 return false;
86 }
87 else
88 {
89 return true;
90 }
91 }
92 }
93 return false;
94 }
class GP5GasMask extends MaskBase ItemBase
proto native CGame GetGame()

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