From b13e504ba15e360fcaf890f5fa16e0c3243fe8b2 Mon Sep 17 00:00:00 2001 From: Nick <42454181+Momo8289@users.noreply.github.com> Date: Mon, 26 Jun 2023 04:30:42 -0400 Subject: [PATCH] Fixes stacks incorrectly stacking with subtypes (#76166) Makes the type check to determine if two items will stack more strict, so that subtypes that shouldn't stack don't. Fixed #76157 --- code/game/objects/items/stacks/stack.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 8f2503847ac..09096e1d656 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -566,7 +566,8 @@ * - [inhand][boolean]: Whether or not the stack to check should act like it's in a mob's hand. */ /obj/item/stack/proc/can_merge(obj/item/stack/check, inhand = FALSE) - if(!istype(check, merge_type)) + // 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(mats_per_unit ~! check.mats_per_unit) // ~! in case of lists this operator checks only keys, but not values return FALSE