From 8dde76eb2fb0c08eb333a9cf7459b6ac4fccc140 Mon Sep 17 00:00:00 2001 From: Roxy <75404941+TealSeer@users.noreply.github.com> Date: Thu, 8 May 2025 02:00:56 -0400 Subject: [PATCH] Fix photocopier silently failing if you can't pay for it (#90997) Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> --- code/modules/paperwork/photocopier.dm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index d05883c86e2..65b34ddb67d 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -320,6 +320,9 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks()) if(get_paper_count() < paper_use * copies_amount) copies_amount = FLOOR(get_paper_count() / paper_use, 1) error_message = span_warning("An error message flashes across \the [src]'s screen: \"Not enough paper to perform [copies_amount >= 1 ? "full " : ""]operation.\"") + if(copies_amount > 0 && (attempt_charge(src, user, (copies_amount - 1) * PHOTOCOPIER_FEE) & COMPONENT_OBJ_CANCEL_CHARGE)) + copies_amount = 0 + error_message = span_warning("An error message flashes across \the [src]'s screen: \"Failed to charge bank account. Aborting.\"") copies_left = copies_amount @@ -328,10 +331,6 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks()) reset_busy() return - if(attempt_charge(src, user, (copies_amount - 1) * PHOTOCOPIER_FEE) & COMPONENT_OBJ_CANCEL_CHARGE) - reset_busy() - return - if(error_message) to_chat(user, error_message)