From 91dd3e55c9d574748b767785b35d479800616161 Mon Sep 17 00:00:00 2001 From: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Date: Fri, 17 Apr 2026 01:21:18 +0100 Subject: [PATCH] allows stack splitting mechanics to be disabled (#31911) --- code/game/objects/items/RCL.dm | 1 + code/game/objects/items/stacks/stack.dm | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/RCL.dm b/code/game/objects/items/RCL.dm index 7d9fe8eb25e..2e7026b2058 100644 --- a/code/game/objects/items/RCL.dm +++ b/code/game/objects/items/RCL.dm @@ -12,6 +12,7 @@ max_amount = RCL_MAX_SPOOL_SIZE amount = RCL_MAX_SPOOL_SIZE color = null + allow_splitting = FALSE /// Are we rapidly laying cable? var/active = FALSE var/spool_color diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 57d368a19e6..4b939c6bb2f 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -36,6 +36,8 @@ var/dynamic_icon_state = FALSE /// Whether this stack can't stack with subtypes. var/parent_stack = FALSE + /// Whether this stack can be split into multiple independent stacks. + var/allow_splitting = TRUE /obj/item/stack/examine(mob/user) . = ..() @@ -196,8 +198,10 @@ /obj/item/stack/attack_hand(mob/user) if(!user.is_in_inactive_hand(src) && get_amount() > 1) - ..() - return + return ..() + + if(!allow_splitting) + return ..() change_stack(user, 1) if(src && user.machine == src) @@ -316,6 +320,9 @@ return to_transfer /obj/item/stack/proc/split(mob/user, amount) + if(!allow_splitting) + return + var/obj/item/stack/material = new type(loc, amount, FALSE) material.copy_evidences(src) if(isliving(user)) @@ -326,6 +333,9 @@ return material /obj/item/stack/proc/change_stack(mob/user,amount) + if(!allow_splitting) + return + var/obj/item/stack/material = new type(user, amount, FALSE) . = material material.copy_evidences(src)