DayZ 1.28
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 isContainerFull = container.IsFullQuantity();
240 if (isContainerFull && !ignore_fullness_check)
241 {
242 //Debug.Log("container is full", "LiquidTransfer");
243 return false;
244
245 }
246
247 int containerMask = container.GetLiquidContainerMask();
248 if (containerMask == 0)
249 {
250 //Debug.Log("target is not a container", "LiquidTransfer");
251 return false;//if the target liquidContainerType is set to 0
252 }
253
254 if ((liquid_type & containerMask) == 0)
255 {
256 //Debug.Log("target liquidContainerType does not support this liquid type", "LiquidTransfer");
257 return false;
258 }
259
260 float containerQuantity = container.GetQuantity();
261
262 int containerLiquidType = container.GetLiquidType();
263
264 if (containerQuantity > 0 && containerLiquidType != TranslateLiquidType(liquid_type))
265 {
266 //Debug.Log("target is not empty AND is of different liquid type than liquid_type added in", "LiquidTransfer");
267 return false;
268 }
269 return true;
270 }
static int TranslateLiquidType(int liquidType)
Translates 'administrative' liquid types into liquid types with valid config class.
Определения Liquid.c:226

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

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