From f42a7d9ab0f4353b1111f840fbcf580ca51d20e7 Mon Sep 17 00:00:00 2001 From: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> Date: Sun, 15 Sep 2024 21:58:29 -0400 Subject: [PATCH] Fixes a runtime caused by stacks accidentally merging twice (#26795) * Fixes empty stacks trying to merge together * more accurate comment --- code/game/objects/items/stacks/stack.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 5b9397d1a9ac..fbecc0325143 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -127,6 +127,8 @@ // We don't only use istype here, since that will match subtypes, and stack things that shouldn't stack if(!istype(check, merge_type) || check.merge_type != merge_type) return FALSE + if(amount <= 0 || check.amount <= 0) // no merging empty stacks that are in the process of being qdel'd + return FALSE if(is_cyborg) // No merging cyborg stacks into other stacks return FALSE if(ismob(loc) && !inhand) // no merging with items that are on the mob