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

◆ CanFillContainer()

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

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

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

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