allows stack splitting mechanics to be disabled (#31911)

This commit is contained in:
CRUNCH
2026-04-17 00:21:18 +00:00
committed by GitHub
parent a714de9149
commit 91dd3e55c9
2 changed files with 13 additions and 2 deletions
+12 -2
View File
@@ -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)