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

◆ ActionCondition()

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

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

26 {
27 ItemBase target_item = ItemBase.Cast(target.GetObject());
28 if (Barrel_ColorBase.Cast(target_item) && !target_item.IsOpen())
29 return false;
30
31 if ( target_item && item && Liquid.CanFillContainer( item, target_item.GetLiquidType(),true ) && Liquid.CanFillContainer( target_item, item.GetLiquidType(), true ) && !GetGame().IsInventoryOpen() ) //TODO find better condition than IsKindOf
32 {
33 if ( target_item.GetQuantity() > target_item.GetQuantityMin() && item.GetQuantity() < item.GetQuantityMax() && !player.GetLiquidTendencyDrain() && Liquid.CanFillContainer( item, target_item.GetLiquidType() ) )
34 {
35 if ( Liquid.CanFillContainer( target_item, item.GetLiquidType() ) )
36 {
37 m_switch_to = 0;//"#liquid_drain";
38 return true;
39 }
40 else
41 {
42 player.SetLiquidTendencyDrain(true);
43 return false;
44 }
45 }
46 if ( item.GetQuantity() > item.GetQuantityMin() && target_item.GetQuantity() < target_item.GetQuantityMax() && player.GetLiquidTendencyDrain() && Liquid.CanFillContainer( target_item, item.GetLiquidType() ) )
47 {
48 if ( Liquid.CanFillContainer( item, target_item.GetLiquidType() ) )
49 {
50 m_switch_to = 1;//"#liquid_pour";
51 return true;
52 }
53 else
54 {
55 player.SetLiquidTendencyDrain(false);
56 return false;
57 }
58 }
59 }
60 return false;
61 }
class GP5GasMask extends MaskBase ItemBase
proto native CGame GetGame()

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