tgstation/-tg-station — pull request #4802 by Menshin (2014-09-12 22:49:16+00:00)
Title: Crafted stacks merging cleaning

* Fixes #4775

After being crafted, stacks are merged with already existing ones on floor. If every stack is full, a new one is created.

The problem was that empty stacks (i.e fully merged) were garbage collected but not removed from the game (they were invisibles, but still in the tile content).
Add to that a faulty empty check and the game was trying to put an empty stack in a soon-to-be-deleted one.

* Various clean-up of code related to stacks.