From 7cf68affc59f77009d89bcd8b0518c360d450a88 Mon Sep 17 00:00:00 2001 From: Gboster-0 <82319946+Gboster-0@users.noreply.github.com> Date: Wed, 19 Nov 2025 04:07:43 +0100 Subject: [PATCH] Makes /empty subtypes of full power cells not charge themselfes up before setting their charge to 0 (#93982) ## About The Pull Request What it says on the tin, simply makes `power_store` subtypes never set themselfes to full instead of setting themselfes to empty after setting themselfes to full. Saving an uncountably small amount of processing and making the code a lil bit cleaner. This could theoretically have an issue if something sets its own `charge` and then has a `/empty` subtype since that wont be emptied, those don't exist though and the only cell that even sets its `charge` to something is the ethereal one that should not have an empty subtype Below be the screenshot of it working, because this 3 line change could truly have disasterous consequences (admin-spawned in order: high-capacity battery, empty high-capacity battery, potato battery) image ## Why It's Good For The Game Cleaner code ## Changelog --- code/modules/power/power_store.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/power/power_store.dm b/code/modules/power/power_store.dm index 7e4852f8459..dee7151f523 100644 --- a/code/modules/power/power_store.dm +++ b/code/modules/power/power_store.dm @@ -52,10 +52,8 @@ if (override_maxcharge) maxcharge = override_maxcharge rating = max(round(maxcharge / (rating_base * 10), 1), 1) - if(!charge) + if(!empty && !charge) charge = maxcharge - if(empty) - charge = 0 if(ratingdesc) desc += " This one has a rating of [display_energy(maxcharge)][prob(10) ? ", and you should not swallow it" : ""]." //joke works better if it's not on every cell update_appearance()