Fix photocopier silently failing if you can't pay for it (#90997)

Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
This commit is contained in:
Roxy
2025-05-08 19:21:08 -04:00
co-authored by SmArtKar
parent b4174cca60
commit 8dde76eb2f
+3 -4
View File
@@ -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)