mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user