Vending machines respects all_products_free (#92665)

## About The Pull Request
- Fixes #92657
This commit is contained in:
SyncIt21
2025-08-26 16:41:10 -05:00
committed by GitHub
parent c66c5c58ab
commit 2aaaad6e15
4 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -396,11 +396,12 @@
/obj/machinery/vending/vv_edit_var(vname, vval)
. = ..()
if (vname == NAMEOF(src, all_products_free))
if(vname == NAMEOF(src, all_products_free))
if (all_products_free)
RemoveComponentSource(src, /datum/component/payment)
qdel(GetComponent(/datum/component/payment))
else
AddComponent(/datum/component/payment, 0, SSeconomy.get_dep_account(payment_department), PAYMENT_VENDING)
update_static_data_for_all_viewers()
/obj/machinery/vending/emp_act(severity)
. = ..()
+1 -1
View File
@@ -161,7 +161,7 @@
speak("Sold out of [item_record.name].")
flick(icon_deny, src)
return
if(onstation)
if(!all_products_free)
// Here we do additional handing ahead of the payment component's logic, such as age restrictions and additional logging
var/obj/item/card/id/card_used
var/mob/living/living_user
-1
View File
@@ -12,7 +12,6 @@
ui = new(user, src, "Vending", name)
ui.open()
/**
* Returns a list of given product records of the vendor to be used in UI.
* arguments:
+2 -1
View File
@@ -65,6 +65,7 @@ export const Vending = () => {
const { data } = useBackend<VendingData>();
const {
all_products_free,
onstation,
ad,
product_records = [],
@@ -111,7 +112,7 @@ export const Vending = () => {
<Window width={431} height={635}>
<Window.Content>
<Stack fill vertical>
{!!onstation && (
{!!onstation && !all_products_free && (
<Stack.Item>
<UserDetails />
</Stack.Item>