forked from Mirrors/openclonk
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
parent
556454fcf4
commit
ea3c5ad920
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue