Skip to content

Commit

Permalink
[MIRROR] Fixes product_categories not working for non-constructable…
Browse files Browse the repository at this point in the history
… vending machines. (#1007)

* Fixes `product_categories` not working for non-constructable vending machines. (#81467)

## About The Pull Request
This is something I've discovered while working on the previous PR.

## Why It's Good For The Game
Prevents future issues with non-constructable vending machines that use
categories, since we don't have any such thing rn.

## Changelog
N/A

* Fixes `product_categories` not working for non-constructable vending machines.

---------

Co-authored-by: Ghom <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Feb 17, 2024
1 parent 01ddf28 commit d6f1da6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/modules/vending/_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@
voice = vendor_voice_by_type[type]

if(build_inv) //non-constructable vending machine
///Non-constructible vending machines do not have a refill canister to populate its products list from,
///Which apparently is still needed in the case we use product categories instead.
if(product_categories)
for(var/list/category as anything in product_categories)
products |= category["products"]
build_inventories()

slogan_list = splittext(product_slogans, ";")
Expand Down

0 comments on commit d6f1da6

Please sign in to comment.