From 8d9f1689ba1bf9b51fe73d8a637910b287ebf41f Mon Sep 17 00:00:00 2001
From: Bloop <13398309+vinylspiders@users.noreply.github.com>
Date: Fri, 13 Sep 2024 07:44:55 -0400
Subject: [PATCH] Decouples free vending machine behavior from the 'onstation'
var (#86548)
## About The Pull Request
The `onstation` var was being used for too many things (AI brand
intelligence + whether the products are free or not), and was
overcomplicating the logic.
On top of that it makes things like trying to make a vending machine
that is considered offstation for purposes of the brand intelligence
event but that still dispenses free goods needlessly difficult.
This PR just decouples the two behaviors and gives the 'free' behavior
its own var.
As a result, the majority of the of `onstation` map varedits are no
longer necessary
Tested with various edge cases, all seem working as intended:
arrivals (onstation, all_free_products = null /
FALSE)

arrivals (onstation, all_free_products =
TRUE)

spacehotel (not onstation, all_free_products =
null)

hauntedruins (not onstation, all_free_products =
FALSE)

silverscale shuttle (not onstation, all_free_products
= TRUE)

labor camp (not onstation, all_free_products =
FALSE)

## Why It's Good For The Game
Less complicated vending machines, less varedits in our maps. Less
confusing code. Ability to spawn a vending machine and varedit it to be
free without affecting any other systems.
## Changelog
N/A
---
.../IceRuins/icemoon_surface_phonebooth.dmm | 2 +-
.../IceRuins/icemoon_surface_pizza.dmm | 4 +--
.../LavaRuins/lavaland_surface_phonebooth.dmm | 4 +--
.../SpaceRuins/hauntedtradingpost.dmm | 30 +++++++++----------
_maps/RandomRuins/SpaceRuins/oldstation.dmm | 12 ++------
_maps/RandomRuins/SpaceRuins/phonebooth.dmm | 4 +--
.../SpaceRuins/spinwardsmoothies.dmm | 4 +--
.../SpaceRuins/whiteshipruin_box.dmm | 4 +--
.../map_files/IceBoxStation/IceBoxStation.dmm | 2 +-
_maps/map_files/Mining/Lavaland.dmm | 2 +-
_maps/shuttles/pirate_default.dmm | 4 +--
_maps/shuttles/pirate_irs.dmm | 8 ++---
_maps/shuttles/pirate_silverscale.dmm | 8 ++---
_maps/templates/shelter_3.dmm | 13 ++------
.../items/circuitboards/circuitboard.dm | 4 +--
.../mapfluff/ruins/objects_and_mobs/museum.dm | 2 +-
code/modules/vending/_vending.dm | 26 +++++++++++-----
code/modules/vending/subtype.dm | 2 +-
code/modules/vending/sustenance.dm | 2 +-
tgui/packages/tgui/interfaces/Vending.tsx | 13 ++++----
20 files changed, 66 insertions(+), 84 deletions(-)
diff --git a/_maps/RandomRuins/IceRuins/icemoon_surface_phonebooth.dmm b/_maps/RandomRuins/IceRuins/icemoon_surface_phonebooth.dmm
index 2e500943b64..905403954b6 100644
--- a/_maps/RandomRuins/IceRuins/icemoon_surface_phonebooth.dmm
+++ b/_maps/RandomRuins/IceRuins/icemoon_surface_phonebooth.dmm
@@ -70,7 +70,7 @@
/area/ruin/powered/icemoon_phone_booth)
"W" = (
/obj/machinery/vending/cigarette{
- onstation_override = 1
+ all_products_free = 0
},
/obj/structure/window/reinforced/spawner/directional/east,
/turf/open/floor/plating/icemoon,
diff --git a/_maps/RandomRuins/IceRuins/icemoon_surface_pizza.dmm b/_maps/RandomRuins/IceRuins/icemoon_surface_pizza.dmm
index 121f9e4ea45..c9b3d35aa72 100644
--- a/_maps/RandomRuins/IceRuins/icemoon_surface_pizza.dmm
+++ b/_maps/RandomRuins/IceRuins/icemoon_surface_pizza.dmm
@@ -538,9 +538,7 @@
},
/area/ruin/pizzeria)
"yP" = (
-/obj/machinery/vending/dinnerware{
- onstation = 0
- },
+/obj/machinery/vending/dinnerware,
/obj/effect/turf_decal/tile/blue/opposingcorners{
dir = 1
},
diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_phonebooth.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_phonebooth.dmm
index 851cfe35548..532c90f6084 100644
--- a/_maps/RandomRuins/LavaRuins/lavaland_surface_phonebooth.dmm
+++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_phonebooth.dmm
@@ -13,7 +13,7 @@
/area/ruin/powered/lavaland_phone_booth)
"k" = (
/obj/machinery/vending/snack/green{
- onstation_override = 1
+ all_products_free = 0;
},
/obj/structure/window/reinforced/spawner/directional/east,
/turf/open/floor/plating/lavaland_atmos,
@@ -66,7 +66,7 @@
/area/ruin/powered/lavaland_phone_booth)
"W" = (
/obj/machinery/vending/cigarette{
- onstation_override = 1
+ all_products_free = 0;
},
/obj/structure/window/reinforced/spawner/directional/east,
/turf/open/floor/plating/lavaland_atmos,
diff --git a/_maps/RandomRuins/SpaceRuins/hauntedtradingpost.dmm b/_maps/RandomRuins/SpaceRuins/hauntedtradingpost.dmm
index 50e0bffd567..df3c3ca6427 100644
--- a/_maps/RandomRuins/SpaceRuins/hauntedtradingpost.dmm
+++ b/_maps/RandomRuins/SpaceRuins/hauntedtradingpost.dmm
@@ -139,7 +139,7 @@
"bq" = (
/obj/structure/cable/layer1,
/obj/machinery/vending/sovietsoda{
- onstation_override = 1
+ all_products_free = 0
},
/obj/structure/sign/poster/contraband/clown/directional/east,
/obj/machinery/duct,
@@ -527,7 +527,7 @@
"dU" = (
/obj/structure/cable/layer1,
/obj/machinery/vending/cigarette/syndicate{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/duct,
/obj/effect/mapping_helpers/broken_machine,
@@ -544,7 +544,7 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer4,
/obj/machinery/duct,
/obj/machinery/vending/clothing{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/firealarm/directional/south,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden{
@@ -1378,7 +1378,7 @@
/area/ruin/space/has_grav/hauntedtradingpost/office/meetingroom)
"lT" = (
/obj/machinery/vending/cola/black{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/duct,
/obj/effect/mapping_helpers/broken_machine,
@@ -1866,7 +1866,7 @@
/obj/structure/cable/layer1,
/obj/machinery/duct,
/obj/machinery/vending/assist{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/camera/xray/directional/west,
/turf/open/floor/catwalk_floor/iron_smooth,
@@ -2475,7 +2475,7 @@
/obj/structure/cable/layer1,
/obj/machinery/duct,
/obj/machinery/vending/cola/shamblers{
- onstation_override = 1
+ all_products_free = 0
},
/turf/open/floor/catwalk_floor/iron_smooth,
/area/ruin/space/has_grav/hauntedtradingpost/public/corridor)
@@ -4199,7 +4199,7 @@
"KH" = (
/obj/structure/cable/layer1,
/obj/machinery/vending/donksnack{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/duct,
/obj/machinery/camera/autoname/directional/west{
@@ -4516,7 +4516,7 @@
"MO" = (
/obj/machinery/duct,
/obj/machinery/vending/snack{
- onstation_override = 1
+ all_products_free = 0
},
/turf/open/floor/catwalk_floor/iron_smooth,
/area/ruin/space/has_grav/hauntedtradingpost/public/corridor)
@@ -4616,7 +4616,7 @@
"NY" = (
/obj/structure/cable/layer1,
/obj/machinery/vending/coffee{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/duct,
/turf/open/floor/catwalk_floor/iron_smooth,
@@ -4755,7 +4755,7 @@
"Pk" = (
/obj/structure/cable/layer1,
/obj/machinery/vending/tool{
- onstation_override = 1
+ all_products_free = 0
},
/obj/structure/sign/poster/contraband/donk_co/directional/west,
/obj/machinery/duct,
@@ -4886,7 +4886,7 @@
"QM" = (
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer4,
/obj/machinery/vending/sovietsoda{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden{
pipe_color = "#FF7B00";
@@ -5415,7 +5415,7 @@
/obj/structure/cable/layer1,
/obj/machinery/duct,
/obj/machinery/vending/medical{
- onstation_override = 1;
+ all_products_free = 0;
name = "\improper CyberMed +"
},
/turf/open/floor/catwalk_floor/iron_smooth,
@@ -5635,7 +5635,7 @@
/area/ruin/space/has_grav/hauntedtradingpost/office)
"Ww" = (
/obj/machinery/vending/coffee{
- onstation_override = 1
+ all_products_free = 0
},
/obj/structure/cable/layer1,
/obj/machinery/duct,
@@ -5712,7 +5712,7 @@
"Xe" = (
/obj/structure/cable/layer1,
/obj/machinery/vending/cola/shamblers{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/duct,
/obj/effect/overloader_trap,
@@ -5802,7 +5802,7 @@
/area/ruin/space/has_grav/hauntedtradingpost/public)
"XK" = (
/obj/machinery/vending/donksnack{
- onstation_override = 1
+ all_products_free = 0
},
/obj/machinery/duct,
/turf/open/floor/catwalk_floor/iron_smooth,
diff --git a/_maps/RandomRuins/SpaceRuins/oldstation.dmm b/_maps/RandomRuins/SpaceRuins/oldstation.dmm
index 55f0f884f16..0c3c231b5f2 100644
--- a/_maps/RandomRuins/SpaceRuins/oldstation.dmm
+++ b/_maps/RandomRuins/SpaceRuins/oldstation.dmm
@@ -1645,9 +1645,7 @@
/area/ruin/space/ancientstation/charlie/hall)
"hr" = (
/obj/effect/decal/cleanable/dirt,
-/obj/machinery/vending/dinnerware{
- onstation = 0
- },
+/obj/machinery/vending/dinnerware,
/turf/open/floor/iron/cafeteria,
/area/ruin/space/ancientstation/charlie/kitchen)
"ht" = (
@@ -2368,9 +2366,7 @@
/obj/effect/decal/cleanable/dirt,
/obj/effect/decal/cleanable/cobweb/cobweb2,
/obj/effect/decal/cleanable/dirt,
-/obj/machinery/vending/coffee{
- onstation = 0
- },
+/obj/machinery/vending/coffee,
/turf/open/floor/iron,
/area/ruin/space/ancientstation/charlie/dorms)
"ku" = (
@@ -2744,9 +2740,7 @@
/turf/open/floor/plating,
/area/ruin/space/ancientstation/charlie/hall)
"lU" = (
-/obj/machinery/vending/hydronutrients{
- onstation = 0
- },
+/obj/machinery/vending/hydronutrients,
/obj/effect/turf_decal/tile/green/anticorner/contrasted,
/turf/open/floor/iron,
/area/ruin/space/ancientstation/charlie/hydro)
diff --git a/_maps/RandomRuins/SpaceRuins/phonebooth.dmm b/_maps/RandomRuins/SpaceRuins/phonebooth.dmm
index 2eb0698ebbf..1cf0f64e7ff 100644
--- a/_maps/RandomRuins/SpaceRuins/phonebooth.dmm
+++ b/_maps/RandomRuins/SpaceRuins/phonebooth.dmm
@@ -13,7 +13,7 @@
/area/ruin/space/has_grav/powered/space_phone_booth)
"k" = (
/obj/machinery/vending/snack/green{
- onstation_override = 1
+ all_products_free = 1
},
/obj/structure/window/reinforced/spawner/directional/east,
/turf/open/floor/plating/airless,
@@ -66,7 +66,7 @@
/area/ruin/space/has_grav/powered/space_phone_booth)
"W" = (
/obj/machinery/vending/cigarette{
- onstation_override = 1
+ all_products_free = 0
},
/obj/structure/window/reinforced/spawner/directional/east,
/turf/open/floor/plating/airless,
diff --git a/_maps/RandomRuins/SpaceRuins/spinwardsmoothies.dmm b/_maps/RandomRuins/SpaceRuins/spinwardsmoothies.dmm
index 723c4728d5b..1ac14090b39 100644
--- a/_maps/RandomRuins/SpaceRuins/spinwardsmoothies.dmm
+++ b/_maps/RandomRuins/SpaceRuins/spinwardsmoothies.dmm
@@ -44,9 +44,7 @@
},
/area/ruin/space/has_grav/spinwardsmoothies)
"ti" = (
-/obj/machinery/vending/boozeomat{
- onstation = 0
- },
+/obj/machinery/vending/boozeomat,
/turf/open/floor/wood/tile,
/area/ruin/space/has_grav/spinwardsmoothies)
"wv" = (
diff --git a/_maps/RandomRuins/SpaceRuins/whiteshipruin_box.dmm b/_maps/RandomRuins/SpaceRuins/whiteshipruin_box.dmm
index 602aa1a273b..12bc608bda9 100644
--- a/_maps/RandomRuins/SpaceRuins/whiteshipruin_box.dmm
+++ b/_maps/RandomRuins/SpaceRuins/whiteshipruin_box.dmm
@@ -1331,9 +1331,7 @@
/obj/effect/turf_decal/tile/blue/anticorner/contrasted{
dir = 8
},
-/obj/machinery/vending/medical{
- onstation = 0
- },
+/obj/machinery/vending/medical,
/turf/open/floor/iron/showroomfloor/airless,
/area/ruin/space/has_grav/whiteship/box)
"PV" = (
diff --git a/_maps/map_files/IceBoxStation/IceBoxStation.dmm b/_maps/map_files/IceBoxStation/IceBoxStation.dmm
index e95bf83f272..d10c4403a0b 100644
--- a/_maps/map_files/IceBoxStation/IceBoxStation.dmm
+++ b/_maps/map_files/IceBoxStation/IceBoxStation.dmm
@@ -74196,7 +74196,7 @@
/area/station/security/prison/rec)
"vwG" = (
/obj/machinery/vending/security{
- onstation_override = 1
+ all_products_free = 0
},
/obj/effect/turf_decal/tile/red/half/contrasted{
dir = 8
diff --git a/_maps/map_files/Mining/Lavaland.dmm b/_maps/map_files/Mining/Lavaland.dmm
index 01234def932..caa7913d2fc 100644
--- a/_maps/map_files/Mining/Lavaland.dmm
+++ b/_maps/map_files/Mining/Lavaland.dmm
@@ -8836,7 +8836,7 @@
/area/mine/laborcamp/security)
"Ya" = (
/obj/machinery/vending/security{
- onstation_override = 1
+ all_products_free = 0
},
/obj/effect/turf_decal/trimline/red/filled/line{
dir = 10
diff --git a/_maps/shuttles/pirate_default.dmm b/_maps/shuttles/pirate_default.dmm
index ae81515d1e6..182f51ad3b6 100644
--- a/_maps/shuttles/pirate_default.dmm
+++ b/_maps/shuttles/pirate_default.dmm
@@ -567,9 +567,7 @@
/turf/open/floor/iron,
/area/shuttle/pirate)
"bH" = (
-/obj/machinery/vending/boozeomat{
- onstation = 0
- },
+/obj/machinery/vending/boozeomat,
/obj/effect/turf_decal/tile/bar/opposingcorners,
/turf/open/floor/iron,
/area/shuttle/pirate)
diff --git a/_maps/shuttles/pirate_irs.dmm b/_maps/shuttles/pirate_irs.dmm
index 5969f9a2092..c78c73a7538 100644
--- a/_maps/shuttles/pirate_irs.dmm
+++ b/_maps/shuttles/pirate_irs.dmm
@@ -946,9 +946,7 @@
},
/area/shuttle/pirate)
"Cf" = (
-/obj/machinery/vending/autodrobe{
- onstation = 0
- },
+/obj/machinery/vending/autodrobe,
/obj/effect/turf_decal/siding/dark_green{
dir = 6
},
@@ -1642,9 +1640,7 @@
/turf/open/floor/wood,
/area/shuttle/pirate)
"QT" = (
-/obj/machinery/vending/boozeomat{
- onstation = 0
- },
+/obj/machinery/vending/boozeomat,
/turf/closed/wall/mineral/titanium,
/area/shuttle/pirate)
"QV" = (
diff --git a/_maps/shuttles/pirate_silverscale.dmm b/_maps/shuttles/pirate_silverscale.dmm
index 91d9d97ac0c..b95c32be7d1 100644
--- a/_maps/shuttles/pirate_silverscale.dmm
+++ b/_maps/shuttles/pirate_silverscale.dmm
@@ -492,9 +492,7 @@
/turf/open/floor/iron/dark,
/area/shuttle/pirate)
"CW" = (
-/obj/machinery/vending/boozeomat{
- onstation = 0
- },
+/obj/machinery/vending/boozeomat,
/turf/open/floor/iron/dark/textured,
/area/shuttle/pirate)
"DX" = (
@@ -967,9 +965,7 @@
/turf/open/floor/carpet/royalblack,
/area/shuttle/pirate)
"XB" = (
-/obj/machinery/vending/boozeomat{
- onstation = 0
- },
+/obj/machinery/vending/boozeomat,
/obj/machinery/light/small/directional/south,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden{
dir = 10
diff --git a/_maps/templates/shelter_3.dmm b/_maps/templates/shelter_3.dmm
index 4e1c811d037..2bae50e8ba7 100644
--- a/_maps/templates/shelter_3.dmm
+++ b/_maps/templates/shelter_3.dmm
@@ -35,9 +35,7 @@
/turf/open/floor/pod/dark,
/area/misc/survivalpod)
"h" = (
-/obj/machinery/vending/boozeomat{
- onstation = 0
- },
+/obj/machinery/vending/boozeomat,
/turf/open/floor/pod/dark,
/area/misc/survivalpod)
"i" = (
@@ -146,9 +144,7 @@
/turf/open/floor/carpet/black,
/area/misc/survivalpod)
"z" = (
-/obj/machinery/vending/cigarette{
- onstation = 0
- },
+/obj/machinery/vending/cigarette,
/turf/open/floor/carpet/black,
/area/misc/survivalpod)
"A" = (
@@ -226,10 +222,7 @@
/turf/open/floor/carpet/black,
/area/misc/survivalpod)
"L" = (
-/obj/machinery/vending/snack/blue{
- req_access = null;
- onstation = 0
- },
+/obj/machinery/vending/snack/blue,
/turf/open/floor/carpet/black,
/area/misc/survivalpod)
"M" = (
diff --git a/code/game/objects/items/circuitboards/circuitboard.dm b/code/game/objects/items/circuitboards/circuitboard.dm
index 236b6ed402c..6439ef9ccbe 100644
--- a/code/game/objects/items/circuitboards/circuitboard.dm
+++ b/code/game/objects/items/circuitboards/circuitboard.dm
@@ -17,8 +17,8 @@
grind_results = list(/datum/reagent/silicon = 20)
greyscale_colors = CIRCUIT_COLOR_GENERIC
var/build_path = null
- ///determines if the circuit board originated from a vendor off station or not.
- var/onstation = TRUE
+ /// whether or not the circuit board will build into a vendor whose products cost nothing (used for offstation vending machines mostly)
+ var/all_products_free = FALSE
///determines if the board requires specific levels of parts. (ie specifically a femto menipulator vs generic manipulator)
var/specific_parts = FALSE
diff --git a/code/modules/mapfluff/ruins/objects_and_mobs/museum.dm b/code/modules/mapfluff/ruins/objects_and_mobs/museum.dm
index 57f20abb1aa..fc9f8d36ce0 100644
--- a/code/modules/mapfluff/ruins/objects_and_mobs/museum.dm
+++ b/code/modules/mapfluff/ruins/objects_and_mobs/museum.dm
@@ -159,7 +159,7 @@
mask = /obj/item/clothing/mask/fakemoustache/italian
/obj/machinery/vending/hotdog/museum
- onstation_override = TRUE
+ all_products_free = TRUE
/obj/machinery/vending/hotdog/museum/screwdriver_act(mob/living/user, obj/item/attack_item)
return NONE
diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm
index 817d3b68033..75d758eec19 100644
--- a/code/modules/vending/_vending.dm
+++ b/code/modules/vending/_vending.dm
@@ -187,16 +187,23 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock)
/**
* Is this item on station or not
*
- * if it doesn't originate from off-station during mapload, everything is free
+ * if it doesn't originate from off-station during mapload, all_products_free gets automatically set to TRUE if it was unset previously.
* if it's off-station during mapload, it's also safe from the brand intelligence event
*/
var/onstation = TRUE
/**
- * A variable to change on a per instance basis on the map that allows the instance
- * to ignore whether it's on the station or not.
- * Useful to force cost and ID requirements. DO NOT APPLY THIS GLOBALLY.
+ * DO NOT APPLY THIS GLOBALLY. For mapping var edits only.
+ * A variable to change on a per instance basis that allows the instance to avoid having onstation set for them during mapload.
+ * Setting this to TRUE means that the vending machine is treated as if it were still onstation if it spawns off-station during mapload.
+ * Useful to specify an off-station machine that will be affected by machine-brand intelligence for whatever reason.
*/
var/onstation_override = FALSE
+ /**
+ * If this is set to TRUE, all products sold by the vending machine are free (cost nothing).
+ * If unset, this will get automatically set to TRUE during init if the machine originates from off-station during mapload.
+ * Defaults to null, set it to TRUE or FALSE explicitly on a per-machine basis if you want to force it to be a certain value.
+ */
+ var/all_products_free
///Items that the players have loaded into the vendor
var/list/vending_machine_input = list()
@@ -260,8 +267,10 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock)
if(!is_station_level(z))
if(!onstation_override)
onstation = FALSE
+ if(isnull(all_products_free)) // Only auto-set the free products var if we haven't explicitly assigned a value to it yet.
+ all_products_free = TRUE
if(circuit)
- circuit.onstation = onstation //sync up the circuit so the pricing schema is carried over if it's reconstructed.
+ circuit.all_products_free = all_products_free //sync up the circuit so the pricing schema is carried over if it's reconstructed.
else if(HAS_TRAIT(SSstation, STATION_TRAIT_VENDING_SHORTAGE))
for (var/datum/data/vending_product/product_record as anything in product_records + coin_records + hidden_records)
@@ -275,9 +284,9 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock)
if(tiltable && prob(6)) // 1 in 17 chance to start tilted (as an additional hint to the station trait behind it)
INVOKE_ASYNC(src, PROC_REF(tilt), loc)
credits_contained = 0 // If it's tilted, it's been looted, so no credits for you.
- else if(circuit && (circuit.onstation != onstation)) //check if they're not the same to minimize the amount of edited values.
- onstation = circuit.onstation //if it was constructed outside mapload, sync the vendor up with the circuit's var so you can't bypass price requirements by moving / reconstructing it off station.
- if(onstation && !onstation_override)
+ else if(circuit)
+ all_products_free = circuit.all_products_free //if it was constructed outside mapload, sync the vendor up with the circuit's var so you can't bypass price requirements by moving / reconstructing it off station.
+ if(!all_products_free)
AddComponent(/datum/component/payment, 0, SSeconomy.get_dep_account(payment_department), PAYMENT_VENDING)
GLOB.vending_machines_to_restock += src //We need to keep track of the final onstation vending machines so we can keep them restocked.
register_context()
@@ -1218,6 +1227,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock)
/obj/machinery/vending/ui_static_data(mob/user)
var/list/data = list()
data["onstation"] = onstation
+ data["all_products_free"] = all_products_free
data["department"] = payment_department
data["jobDiscount"] = DEPARTMENT_DISCOUNT
data["product_records"] = list()
diff --git a/code/modules/vending/subtype.dm b/code/modules/vending/subtype.dm
index 3a1a04ff6e7..360eb46defd 100644
--- a/code/modules/vending/subtype.dm
+++ b/code/modules/vending/subtype.dm
@@ -10,7 +10,7 @@
circuit = null
product_slogans = "Spawn \" too annoying? Too lazy to open game panel? This one's for you!;Subtype vendor, for all your debugging woes!"
default_price = 0
- onstation = FALSE
+ all_products_free = TRUE
/// Spawns coders by default
var/type_to_vend = /obj/item/food/grown/citrus
diff --git a/code/modules/vending/sustenance.dm b/code/modules/vending/sustenance.dm
index a1d11c30727..5b54b6bbca4 100644
--- a/code/modules/vending/sustenance.dm
+++ b/code/modules/vending/sustenance.dm
@@ -36,7 +36,7 @@
desc = "A vending machine which vends food, as required by section 47-C of the NT's Prisoner Ethical Treatment Agreement. \
This one, however, processes labor points for its products if the user is incarcerated."
icon_state = "sustenance_labor"
- onstation_override = TRUE
+ all_products_free = FALSE
displayed_currency_icon = "digging"
displayed_currency_name = " LP"
diff --git a/tgui/packages/tgui/interfaces/Vending.tsx b/tgui/packages/tgui/interfaces/Vending.tsx
index 64b62c86c62..ab4ea98a583 100644
--- a/tgui/packages/tgui/interfaces/Vending.tsx
+++ b/tgui/packages/tgui/interfaces/Vending.tsx
@@ -18,6 +18,7 @@ import { DmIcon, Input } from '../components';
import { Window } from '../layouts';
type VendingData = {
+ all_products_free: boolean;
onstation: boolean;
department: string;
jobDiscount: number;
@@ -218,7 +219,7 @@ const ProductDisplay = (props: {
} = props;
const {
stock,
- onstation,
+ all_products_free,
user,
displayed_currency_icon,
displayed_currency_name,
@@ -231,7 +232,7 @@ const ProductDisplay = (props: {
title="Products"
buttons={
- {!!onstation && user && (
+ {!all_products_free && user && (
{(user && user.cash) || 0}
{displayed_currency_name}{' '}
@@ -277,15 +278,15 @@ const ProductDisplay = (props: {
const VendingRow = (props) => {
const { data } = useBackend();
const { custom, product, productStock } = props;
- const { access, department, jobDiscount, onstation, user } = data;
- const free = !onstation || product.price === 0;
+ const { access, department, jobDiscount, all_products_free, user } = data;
+ const free = all_products_free || product.price === 0;
const discount = !product.premium && department === user?.department;
const remaining = custom ? product.amount : productStock.amount;
const redPrice = Math.round(product.price * jobDiscount);
const disabled =
remaining === 0 ||
- (onstation && !user) ||
- (onstation &&
+ (!all_products_free && !user) ||
+ (!all_products_free &&
!access &&
(discount ? redPrice : product.price) > user?.cash);