From 652fd2633ec25a680b219fcae4227f7444ed7971 Mon Sep 17 00:00:00 2001 From: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Date: Tue, 19 May 2026 02:50:14 -0400 Subject: [PATCH] Restocking a Vending machine no longer creates 0 credit holochips. (#96137) ## About The Pull Request The post_restock proc did not have an appropriate check to confirm that there was enough stored credits to produce a non-zero holochip. This adds a quick check for the proc, preventing their creation. ## Why It's Good For The Game One less silly runtime on live. ## Changelog :cl: fix: Restocking a vending machine can no longer produce a zero credit holochip. /:cl: --- code/modules/vending/vendor/interaction.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/vending/vendor/interaction.dm b/code/modules/vending/vendor/interaction.dm index 0e8c2cfc7b9..1cbd7a5ffa2 100644 --- a/code/modules/vending/vendor/interaction.dm +++ b/code/modules/vending/vendor/interaction.dm @@ -159,8 +159,9 @@ to_chat(user, span_notice("You loaded [restocked] items in [src][credits_contained > 0 ? ", and are rewarded [credits_contained] [MONEY_NAME]." : "."]")) var/datum/bank_account/cargo_account = SSeconomy.get_dep_account(ACCOUNT_CAR) cargo_account.adjust_money(round(credits_contained * 0.5), "Vending: Restock") - var/obj/item/holochip/payday = new(src, credits_contained) - try_put_in_hand(payday, user) + if(credits_contained >= 1) + var/obj/item/holochip/payday = new(src, credits_contained) + try_put_in_hand(payday, user) credits_contained = 0 /obj/machinery/vending/exchange_parts(mob/user, obj/item/storage/part_replacer/replacer)