Merge pull request #11387 from Heroman3003/dupefix

Fixes infinite material duplication in R&D
This commit is contained in:
Novacat
2021-08-10 22:50:59 -04:00
committed by Chompstation Bot
parent b8f11af55d
commit b291d87e18
2 changed files with 15 additions and 6 deletions

View File

@@ -302,6 +302,7 @@
if(uses_charge)
return null
tamount = round(tamount)
var/transfer = max(min(tamount, src.amount, initial(max_amount)), 0)
var/orig_amount = src.amount

View File

@@ -423,6 +423,14 @@
to_chat(usr, "<span class='notice'>The destructive analyzer appears to be empty.</span>")
return
if(istype(linked_destroy.loaded_item,/obj/item/stack))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/ST = linked_destroy.loaded_item
if(ST.get_amount() < 1)
playsound(linked_destroy, 'sound/machines/destructive_analyzer.ogg', 50, 1)
qdel(ST)
linked_destroy.icon_state = "d_analyzer"
return
for(var/T in linked_destroy.loaded_item.origin_tech)
files.UpdateTech(T, linked_destroy.loaded_item.origin_tech[T])
if(linked_lathe && linked_destroy.loaded_item.matter) // Also sends salvaged materials to a linked protolathe, if any.