Refactoring: Simplified script.

Unit tests still pass.
liquid_container
Mark 2016-03-25 16:31:17 +01:00
parent a34eea41dc
commit db061b5cad
2 changed files with 2 additions and 8 deletions

View File

@ -850,10 +850,7 @@ public func RejectCollect(id item_id, object item)
// Is the object a container? If so, try to empty it.
if (item->~IsContainer() || item->~IsLiquidContainer())
{
var count = item->ContentsCount(), contents;
while (--count >= 0)
if (contents = item->Contents(count))
contents->Enter(this);
GrabContents(item);
}
// Can we collect the object itself?
if (IsCollectionAllowed(item))

View File

@ -39,10 +39,7 @@ protected func RejectCollect(id item, object obj)
// Is the object a container? If so, try to empty it.
if (obj->~IsContainer() || obj->~IsLiquidContainer())
{
var count = obj->ContentsCount(), contents;
while (--count >= 0)
if (contents = obj->Contents(count))
contents->Enter(this);
GrabContents(obj);
}
return true;
}