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
244 return false;
245
246 }
247 int container_mask = container.GetLiquidContainerMask();
248
249 if (container_mask == 0)
250 {
251
252 return false;
253 }
254
255 if ((liquid_type & container_mask) == 0)
256 {
257
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
268 return false;
269 }
270 return true;
271 }