[NO GBP] Fixes empty vending canisters in some cases (#92538)

## About The Pull Request
- Fixes #92527
- Closes #92537

## Changelog
🆑
fix: product category vendors start out correctly filled & can be
refilled with cargo ordered vending canisters again
/🆑
This commit is contained in:
SyncIt21
2025-08-19 22:34:05 -04:00
committed by nevimer
parent 80d933d3e9
commit e1a722580a
3 changed files with 21 additions and 12 deletions
+9 -12
View File
@@ -35,26 +35,23 @@
. = ..()
name = "\improper [machine_name] restocking unit"
if(istype(loc, /obj/machinery/vending))
var/obj/machinery/vending/vendor = loc
products = vendor.products.Copy()
contraband = vendor.contraband.Copy()
premium = vendor.premium.Copy()
else
products = list()
contraband = list()
premium = list()
/obj/item/vending_refill/examine(mob/user)
. = ..()
var/num = get_part_rating()
if (!num)
. += "It's empty!"
. += span_notice("It's empty!")
else if(num == INFINITY)
. += span_notice("It's full of supplies!")
else
. += "It can restock [num] item\s."
. += span_notice("It can restock [num] item\s.")
/obj/item/vending_refill/get_part_rating()
. = 0
//first time needs to be filled by the vending machine
if(!products)
return INFINITY
for(var/key in products)
. += products[key]
for(var/key in contraband)