mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #11387 from Heroman3003/dupefix
Fixes infinite material duplication in R&D
This commit is contained in:
committed by
Chompstation Bot
parent
b8f11af55d
commit
b291d87e18
@@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
/obj/item/stack/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
/obj/item/stack/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||||
var/list/data = ..()
|
var/list/data = ..()
|
||||||
|
|
||||||
data["amount"] = get_amount()
|
data["amount"] = get_amount()
|
||||||
|
|
||||||
return data
|
return data
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
if(get_amount() < 1)
|
if(get_amount() < 1)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
var/datum/stack_recipe/R = locate(params["ref"])
|
var/datum/stack_recipe/R = locate(params["ref"])
|
||||||
if(!is_valid_recipe(R, recipes)) //href exploit protection
|
if(!is_valid_recipe(R, recipes)) //href exploit protection
|
||||||
return FALSE
|
return FALSE
|
||||||
@@ -302,6 +302,7 @@
|
|||||||
if(uses_charge)
|
if(uses_charge)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
|
tamount = round(tamount)
|
||||||
var/transfer = max(min(tamount, src.amount, initial(max_amount)), 0)
|
var/transfer = max(min(tamount, src.amount, initial(max_amount)), 0)
|
||||||
|
|
||||||
var/orig_amount = src.amount
|
var/orig_amount = src.amount
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
"loaded_item" = linked_destroy.loaded_item,
|
"loaded_item" = linked_destroy.loaded_item,
|
||||||
"origin_tech" = tgui_GetOriginTechForItem(linked_destroy.loaded_item),
|
"origin_tech" = tgui_GetOriginTechForItem(linked_destroy.loaded_item),
|
||||||
)
|
)
|
||||||
|
|
||||||
data["info"]["linked_lathe"] = list("present" = FALSE)
|
data["info"]["linked_lathe"] = list("present" = FALSE)
|
||||||
if(linked_lathe)
|
if(linked_lathe)
|
||||||
data["info"]["linked_lathe"] = list(
|
data["info"]["linked_lathe"] = list(
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
data["info"]["t_disk"]["name"] = t_disk.stored.name
|
data["info"]["t_disk"]["name"] = t_disk.stored.name
|
||||||
data["info"]["t_disk"]["level"] = t_disk.stored.level
|
data["info"]["t_disk"]["level"] = t_disk.stored.level
|
||||||
data["info"]["t_disk"]["desc"] = t_disk.stored.desc
|
data["info"]["t_disk"]["desc"] = t_disk.stored.desc
|
||||||
|
|
||||||
data["info"]["d_disk"] = list("present" = FALSE)
|
data["info"]["d_disk"] = list("present" = FALSE)
|
||||||
if(d_disk)
|
if(d_disk)
|
||||||
data["info"]["d_disk"] = list(
|
data["info"]["d_disk"] = list(
|
||||||
@@ -423,6 +423,14 @@
|
|||||||
to_chat(usr, "<span class='notice'>The destructive analyzer appears to be empty.</span>")
|
to_chat(usr, "<span class='notice'>The destructive analyzer appears to be empty.</span>")
|
||||||
return
|
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)
|
for(var/T in linked_destroy.loaded_item.origin_tech)
|
||||||
files.UpdateTech(T, linked_destroy.loaded_item.origin_tech[T])
|
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.
|
if(linked_lathe && linked_destroy.loaded_item.matter) // Also sends salvaged materials to a linked protolathe, if any.
|
||||||
@@ -491,7 +499,7 @@
|
|||||||
if(!istype(S, /obj/machinery/r_n_d/server/centcom) && server_processed)
|
if(!istype(S, /obj/machinery/r_n_d/server/centcom) && server_processed)
|
||||||
S.produce_heat()
|
S.produce_heat()
|
||||||
busy_msg = null
|
busy_msg = null
|
||||||
files.RefreshResearch()
|
files.RefreshResearch()
|
||||||
update_tgui_static_data(usr, ui)
|
update_tgui_static_data(usr, ui)
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
@@ -583,7 +591,7 @@
|
|||||||
|
|
||||||
if("find_device") //The R&D console looks for devices nearby to link up with.
|
if("find_device") //The R&D console looks for devices nearby to link up with.
|
||||||
busy_msg = "Updating Database..."
|
busy_msg = "Updating Database..."
|
||||||
|
|
||||||
spawn(10)
|
spawn(10)
|
||||||
busy_msg = null
|
busy_msg = null
|
||||||
SyncRDevices()
|
SyncRDevices()
|
||||||
|
|||||||
Reference in New Issue
Block a user