mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user