mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Vending machines respects all_products_free (#92665)
## About The Pull Request - Fixes #92657
This commit is contained in:
+3
-2
@@ -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
@@ -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
@@ -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:
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user