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

◆ CanFillContainer()

static bool CanFillContainer ( ItemBase container,
int liquid_type,
bool ignore_fullness_check = false )
static

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

235 {
236 if (!container)
237 return false;
238
239 bool is_container_full = container.IsFullQuantity();
240
241 if (is_container_full && !ignore_fullness_check)
242 {
243 //Debug.Log("container is full", "LiquidTransfer");
244 return false;
245
246 }
247 int container_mask = container.GetLiquidContainerMask();
248
249 if (container_mask == 0)
250 {
251 //Debug.Log("target is not a container", "LiquidTransfer");
252 return false;//if the target liquidContainerType is set to 0
253 }
254
255 if ((liquid_type & container_mask) == 0)
256 {
257 //Debug.Log("target liquidContainerType does not support this liquid type", "LiquidTransfer");
258 return false;
259 }
260
261 float container_quantity = container.GetQuantity();
262
263 int container_liquid_type = container.GetLiquidType();
264
265 if (container_quantity > 0 && container_liquid_type != liquid_type)
266 {
267 //Debug.Log("target is not empty AND is of different liquid type than liquid_type added in", "LiquidTransfer");
268 return false;
269 }
270 return true;
271 }

Используется в CanTransfer() и FillContainer().