From ea3c5ad9209c665ef70dcc76e63bee0e85053f6c Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 10 Mar 2016 06:14:49 +0100 Subject: [PATCH] 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. --- planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c index e050f380e..f52f3905e 100644 --- a/planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c @@ -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; } }