mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user