Refactoring: Stackable: Simplified TakeObject()

The part where the stack count is reduced behaves the same as DoStackCount(); The stack display is updated in SetStackCount()/DoStackCount() respectively, so that line can be removed.
liquid_container
Mark 2016-03-10 06:14:49 +01:00
parent 556454fcf4
commit ea3c5ad920
1 changed files with 1 additions and 2 deletions

View File

@ -137,10 +137,9 @@ public func TakeObject()
}
else if (count > 1)
{
if (!(this->IsInfiniteStackCount())) SetStackCount(count - 1);
if (!(this->IsInfiniteStackCount())) DoStackCount(-1);
var take = CreateObjectAbove(GetID(), 0, 0, GetOwner());
take->SetStackCount(1);
if (!(this->IsInfiniteStackCount())) UpdateStackDisplay(); // TODO: this is redundant
return take;
}
}