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
This commit is contained in:
Nick
2023-06-26 03:30:42 -05:00
committed by GitHub
parent efb2b94faa
commit b13e504ba1
+2 -1
View File
@@ -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