diff --git a/code/modules/asset_cache/assets/vending.dm b/code/modules/asset_cache/assets/vending.dm index e8b92e59392..e7d2fb9bc37 100644 --- a/code/modules/asset_cache/assets/vending.dm +++ b/code/modules/asset_cache/assets/vending.dm @@ -2,7 +2,16 @@ name = "vending" /datum/asset/spritesheet/vending/create_spritesheets() - for (var/k in GLOB.vending_products) + // initialising the list of items we need + var/target_items = list() + for(var/obj/machinery/vending/vendor as anything in typesof(/obj/machinery/vending)) + vendor = new vendor() // It seems `initial(list var)` has nothing. need to make a type. + for(var/each in list(vendor.products, vendor.premium, vendor.contraband)) + target_items |= each + qdel(vendor) + + // building icons for each item + for (var/k in target_items) var/atom/item = k if (!ispath(item, /atom)) continue diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index cc9d96ca8b9..a375cba9e4e 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -321,7 +321,6 @@ if (dump_amount >= 16) return -GLOBAL_LIST_EMPTY(vending_products) /** * Build the inventory of the vending machine from it's product and record lists * @@ -349,7 +348,6 @@ GLOBAL_LIST_EMPTY(vending_products) var/obj/item/temp = typepath var/datum/data/vending_product/R = new /datum/data/vending_product() - GLOB.vending_products[typepath] = 1 R.name = initial(temp.name) R.product_path = typepath if(!start_empty)