Fix stacks dupe and ore duping with BS crystals (#23948)

This commit is contained in:
dj-34
2024-01-27 00:23:20 +05:00
committed by GitHub
parent 17a68e9242
commit 010aec7f50
2 changed files with 7 additions and 1 deletions
+2
View File
@@ -351,6 +351,8 @@
var/stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack? (Maximum: [max])") as null|num)
if(stackmaterial == null || stackmaterial <= min || stackmaterial > get_amount())
return
if(!Adjacent(user, 1))
return
change_stack(user,stackmaterial)
to_chat(user, "<span class='notice'>You take [stackmaterial] sheets out of the stack.</span>")
+5 -1
View File
@@ -396,7 +396,11 @@
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/amount_compatible = materials.get_item_material_amount(O)
if(amount_compatible)
materials.insert_item(O, sheet_per_ore)
// Prevents duping
if(O.refined_type)
materials.insert_item(O, sheet_per_ore)
else
materials.insert_item(O, 1)
// Delete the stack
ore_buffer -= O
qdel(O)