From fab1c1354c1339fafb6980ec2e405449a049f2c8 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:07:33 +0300 Subject: [PATCH] [MIRROR] [NO GBP] Power outage operation fixes for chem master (#2846) * [NO GBP] Power outage operation fixes for chem master (#82591) ## About The Pull Request - If the chem master runs out of power mid printing, it will properly stop the printing process and its animation - When transferring reagents it correctly checks if we have enough power without forcing it ## Changelog :cl: fix: chem master properly shuts down if it loses power mid printing and won't transfer reagents for the same /:cl: * [NO GBP] Power outage operation fixes for chem master --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> --- code/modules/reagents/chemistry/machinery/chem_master.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index cc6b09c72aa..d2ffea1d5bf 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -402,7 +402,7 @@ return FALSE //use energy - if(!use_energy(active_power_usage)) + if(!use_energy(active_power_usage, force = FALSE)) return FALSE //do the operation @@ -518,7 +518,9 @@ return //use power - if(!use_energy(active_power_usage)) + if(!use_energy(active_power_usage, force = FALSE)) + is_printing = FALSE + update_appearance(UPDATE_OVERLAYS) return //print the stuff