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