Refactoring: Producers: Removed another special case from IsCollectionAllowed()

This special case was handled by the fact that liquid items are components anyway, and the ice object is handled differently.
liquid_container
Mark 2016-03-24 22:26:09 +01:00
parent 0ef237988e
commit b491260fac
1 changed files with 1 additions and 14 deletions

View File

@ -807,6 +807,7 @@ public func IsCollectionAllowed(object item)
{
if (component_id == item_id)
return true;
i++;
}
}
@ -817,20 +818,6 @@ public func IsCollectionAllowed(object item)
if (FuelNeed(product) > 0)
return true;
}
// Liquid objects may be collected if a product needs them.
if (item->~GetLiquidType())
{
for (var product in products)
{
var i = 0, component_id;
while (component_id = GetComponent(nil, i, nil, product))
{
if (component_id->~GetLiquidType() == item->~GetLiquidType())
return true;
i++;
}
}
}
// Convertable liquid objects (ice is the only one so far) may be collected if a product needs them.
// This uses the queue instead of the product list, because other items may need the original object.
// This extremely special case is used by the ice object only, and should be removed in my opinion,