From d7abb2e81e49bfe47b8c18b13f0011a049b7a63c Mon Sep 17 00:00:00 2001 From: FartMaster69420 <78667902+FartMaster69420@users.noreply.github.com> Date: Thu, 14 Apr 2022 00:01:59 -0400 Subject: [PATCH] Fixing issues Adds a check for stacktype and a turf check, preventing bad behavior. --- code/game/objects/items/stacks/stack_vr.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/stacks/stack_vr.dm b/code/game/objects/items/stacks/stack_vr.dm index 25ea848ffb..eb00a7ee9a 100644 --- a/code/game/objects/items/stacks/stack_vr.dm +++ b/code/game/objects/items/stacks/stack_vr.dm @@ -3,6 +3,10 @@ /obj/item/stack/proc/merge(obj/item/stack/S) //Merge src into S, as much as possible if(uses_charge || S.uses_charge) // This should realistically never happen, but in case it does lets avoid breaking things. return + if(S.stacktype != stacktype) + return + if(S.amount >= S.max_amount) + return var/transfer = get_amount() transfer = min(transfer, S.max_amount - S.amount) @@ -15,6 +19,6 @@ S.add(transfer) /obj/item/stack/Crossed(var/atom/movable/AM) - if(AM != src && istype(AM, src.type) && !AM.throwing) + if(isturf(AM.loc) && AM != src && istype(AM, src.type) && !AM.throwing) merge(AM) return ..() \ No newline at end of file