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

◆ ActionCondition()

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

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

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

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