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

◆ ActionCondition()

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

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

29 {
30 Object targetObject = target.GetObject();
31
32 if (item.GetQuantity() == 0)
33 return false;
34
35 // Get the liquid
36 int liquid_type = item.GetLiquidType();
37
38 if (liquid_type != LIQUID_WATER)
39 {
40 return false; // Forbid watering of plants with gasoline and other fluids
41 }
42
43 if (item.GetIsFrozen())
44 {
45 return false;
46 }
47
48 if ( targetObject.IsInherited(GardenBase) )
49 {
50 GardenBase garden_base = GardenBase.Cast( targetObject );
51
52 Slot slot;
53
54 array<string> selections = new array<string>;
55 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
56
57 for (int s = 0; s < selections.Count(); s++)
58 {
59 string selection = selections[s];
60 slot = garden_base.GetSlotBySelection( selection );
61 if (slot)
62 break;
63 }
64
65 if ( slot && !slot.GetPlant() && slot.GetWateredState() == eWateredState.DRY )
66 {
67 return true;
68 }
69 else
70 {
71 return false;
72 }
73 }
74
75 return false;
76 }
class LOD Object
const int LIQUID_WATER
Определения constants.c:539

Перекрестные ссылки ActionTarget и LIQUID_WATER.