diff --git a/code/modules/vending/vendor/_vending.dm b/code/modules/vending/vendor/_vending.dm index 0c4fba16efb..eec128f0f32 100644 --- a/code/modules/vending/vendor/_vending.dm +++ b/code/modules/vending/vendor/_vending.dm @@ -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) . = ..() diff --git a/code/modules/vending/vendor/inventory.dm b/code/modules/vending/vendor/inventory.dm index 5073f5017ae..0777ea2b160 100644 --- a/code/modules/vending/vendor/inventory.dm +++ b/code/modules/vending/vendor/inventory.dm @@ -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 diff --git a/code/modules/vending/vendor/ui_data.dm b/code/modules/vending/vendor/ui_data.dm index e5508c3cd35..3b5c5016d3d 100644 --- a/code/modules/vending/vendor/ui_data.dm +++ b/code/modules/vending/vendor/ui_data.dm @@ -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: diff --git a/tgui/packages/tgui/interfaces/Vending.tsx b/tgui/packages/tgui/interfaces/Vending.tsx index 2ad0a0795e0..8ec94edeed9 100644 --- a/tgui/packages/tgui/interfaces/Vending.tsx +++ b/tgui/packages/tgui/interfaces/Vending.tsx @@ -65,6 +65,7 @@ export const Vending = () => { const { data } = useBackend(); const { + all_products_free, onstation, ad, product_records = [], @@ -111,7 +112,7 @@ export const Vending = () => { - {!!onstation && ( + {!!onstation && !all_products_free && (