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

◆ CanTransfer()

static bool CanTransfer ( ItemBase source_ent,
ItemBase target_ent )
static

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

122 {
123 if (!source_ent || !target_ent)
124 return false;
125
126 Barrel_ColorBase barrelTarget = Barrel_ColorBase.Cast(target_ent);
127 Barrel_ColorBase barrelSource = Barrel_ColorBase.Cast(source_ent);
128 if ((barrelTarget && !barrelTarget.IsOpen()) || (barrelSource && !barrelSource.IsOpen()))
129 {
130 return false;
131 }
132
133 if (source_ent.GetIsFrozen())
134 {
135 return false;
136 }
137
138 float source_quantity = source_ent.GetQuantity();
139 if (source_quantity <= 0)
140 {
141 //Debug.Log("source has no quantity", "LiquidTransfer");
142 return false;//if there is nothing to transfer
143 }
144
145 int source_liquid_type = source_ent.GetLiquidType();
146 if (source_liquid_type < 1)
147 {
148 //Debug.Log("source has some quantity, but does not have a valid liquidType set, liquidType = "+ToString(source_liquid_type), "LiquidTransfer");
149 return false;//if source is not a container
150 }
151
152 if (!CanFillContainer(target_ent,source_liquid_type))
153 {
154 return false;
155 }
156
157 return true;
158 }
static bool CanFillContainer(ItemBase container, int liquid_type, bool ignore_fullness_check=false)
Определения Liquid.c:234
override bool IsOpen()
Определения Barrel_ColorBase.c:125

Перекрестные ссылки CanFillContainer() и Barrel_ColorBase::IsOpen().