From 94e823d9b1d2bfa6a7514b841bf87303b9cece07 Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Sat, 30 Dec 2023 12:37:06 -0500 Subject: [PATCH] Fixes return values of some chem UI actions. (#191) * [NO GBP] Fixes return values of some chem UI actions. (#80648) ## About The Pull Request - The chem heater now returns `TRUE` when its buffer dispense volume is changed thus showing the new value immediately without a 1 second delay - The debug chem synthesizer also now returns `TRUE` when its amount & purity values are changed thus showing their new values immediately without a 1 second delay ## Changelog :cl: fix: chem heater now shows the new value of its buffer dispense volume immediately when it gets changed. fix: debug chem synthesizer now shows the new values of amount & purity immediately when it gets changed. /:cl: * [NO GBP] Fixes return values of some chem UI actions. --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: NovaBot --- .../chemistry/machinery/chem_heater.dm | 2 +- .../chemistry/machinery/chem_synthesizer.dm | 28 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index c31c099c255..a81b189f426 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -332,7 +332,7 @@ return FALSE dispense_volume = target - return FALSE + return TRUE /** * Injects either acid/base buffer into the beaker diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm index 6177baa269a..686196b73ff 100644 --- a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm +++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm @@ -45,16 +45,28 @@ return TRUE if("amount") - var/input = text2num(params["amount"]) - if(input) - amount = input - return FALSE + var/input = params["amount"] + if(isnull(input)) + return FALSE + + input = text2num(input) + if(isnull(input)) + return FALSE + + amount = input + return TRUE if("purity") - var/input = text2num(params["amount"]) - if(input) - purity = input - return FALSE + var/input = params["amount"] + if(isnull(input)) + return FALSE + + input = text2num(input) + if(isnull(input)) + return FALSE + + purity = input + return TRUE update_appearance()