Files
Bubberstation/modular_zubbers/code/modules/vending/vending.dm
Cursor 33aeffd25b Killing the Module Folder with a Chainsaw and taking it's skin for a mask. (#1624)
## About The Pull Request

Title. This WILL break shit. Probably. Help me sweet Jesus.

## Why It's Good For The Game

House of Leaves is less confusing than our file structure.

## Proof Of Testing


## Changelog

🆑
fix: MASSIVE File Structure clean-up.
/🆑

---------

Co-authored-by: Waterpig <49160555+Majkl-J@users.noreply.github.com>
2024-06-12 18:59:14 +02:00

47 lines
1.8 KiB
Plaintext

//Taken from Modular Vending in Skyrat
/obj/machinery/vending
/// Additions to the `products` list of the vending machine, modularly. Will become null after Initialize, to free up memory.
var/list/zubbers_products
/// Additions to the `product_categories` list of the vending machine, modularly. Will become null after Initialize, to free up memory.
var/list/zubbers_product_categories
/// Additions to the `premium` list of the vending machine, modularly. Will become null after Initialize, to free up memory.
var/list/zubbers_premium
/// Additions to the `contraband` list of the vending machine, modularly. Will become null after Initialize, to free up memory.
var/list/zubbers_contraband
/obj/machinery/vending/Initialize(mapload)
if(zubbers_products)
// We need this, because duplicates screw up the spritesheet!
for(var/item_to_add in zubbers_products)
products[item_to_add] = zubbers_products[item_to_add]
if(zubbers_product_categories)
for(var/category in zubbers_product_categories)
var/already_exists = FALSE
for(var/existing_category in product_categories)
if(existing_category["name"] == category["name"])
existing_category["products"] += category["products"]
already_exists = TRUE
break
if(!already_exists)
product_categories += category
if(zubbers_premium)
// We need this, because duplicates screw up the spritesheet!
for(var/item_to_add in zubbers_premium)
premium[item_to_add] = zubbers_premium[item_to_add]
if(zubbers_contraband)
// We need this, because duplicates screw up the spritesheet!
for(var/item_to_add in zubbers_contraband)
contraband[item_to_add] = zubbers_contraband[item_to_add]
QDEL_NULL(zubbers_products)
QDEL_NULL(zubbers_product_categories)
QDEL_NULL(zubbers_premium)
QDEL_NULL(zubbers_contraband)
return ..()