From 0af5c53dd7ae2fd995903bdab632f2e385003db8 Mon Sep 17 00:00:00 2001 From: nicetoolbox Date: Sat, 3 Oct 2020 01:18:17 -0700 Subject: [PATCH] update_from_disk timer --- code/modules/research/rdconsole.dm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index f589aca7fc1..202fd280486 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -247,6 +247,15 @@ won't update every console in existence) but it's more of a hassle to do. Also, +/obj/machinery/computer/rdconsole/proc/update_from_disk() + clear_wait_message() + if(d_disk && d_disk.blueprint) + files.AddDesign2Known(d_disk.blueprint) + else if(t_disk && t_disk.stored) + files.AddTech2Known(t_disk.stored) + SStgui.update_uis(src) + griefProtection() //Update centcom too + /obj/machinery/computer/rdconsole/proc/reset_research() qdel(files) files = new /datum/research(src) @@ -318,12 +327,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, if("updt_tech") //Update the research holder with information from the technology disk. add_wait_message("Updating Database...", TECH_UPDATE_DELAY) - spawn(TECH_UPDATE_DELAY) - clear_wait_message() - if(t_disk && t_disk.stored) - files.AddTech2Known(t_disk.stored) - SStgui.update_uis(src) - griefProtection() //Update centcom too + addtimer(CALLBACK(src, .proc/update_from_disk), TECH_UPDATE_DELAY) if("clear_tech") //Erase data on the technology disk. if(t_disk) @@ -348,12 +352,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, if("updt_design") //Updates the research holder with design data from the design disk. add_wait_message("Updating Database...", DESIGN_UPDATE_DELAY) - spawn(DESIGN_UPDATE_DELAY) - clear_wait_message() - if(d_disk && d_disk.blueprint) - files.AddDesign2Known(d_disk.blueprint) - SStgui.update_uis(src) - griefProtection() //Update centcom too + addtimer(CALLBACK(src, .proc/update_from_disk), DESIGN_UPDATE_DELAY) if("clear_design") //Erases data on the design disk. if(d_disk)