From 51d84cfbbbec352f70699868a39c02ea8419da4c Mon Sep 17 00:00:00 2001 From: hyperjll <105099113+hyperjll@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:27:34 -0500 Subject: [PATCH] Fixes custom vendors not displaying custom item names (#88985) ## About The Pull Request Something that's really bugged me for a while, custom vendors don't display custom names on items. Nobody cared enough to fix this but me. Guess you can count on me, eh? Tested this on my own private server, worked fine. The items still technically merge by type, so if you place one item with a custom name first, then another of the same type with no custom name OR with a different custom name, the newly inserted item's listed name will override the other until it's bought. ## Why It's Good For The Game Fixes https://github.com/tgstation/tgstation/issues/84937 / https://github.com/tgstation/tgstation/issues/83151 (technically) ## Changelog :cl: fix: A single enthusiastic chemist hell-bent on selling chemicals to his co-workers single-handedly solved a programming issue with our custom vendors. They'll begin displaying custom names (such as those provided by labels) once more. /:cl: --- code/modules/vending/_vending.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 89a9b14da5b..ca5e6e48708 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -1760,9 +1760,11 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) if(vending_machine_input[stocked_item] > 0) var/base64 var/price = 0 + var/itemname = initial(stocked_item.name) for(var/obj/item/stored_item in contents) if(stored_item.type == stocked_item) price = stored_item.custom_price + itemname = stored_item.name if(!base64) //generate an icon of the item to use in UI if(base64_cache[stored_item.type]) base64 = base64_cache[stored_item.type] @@ -1772,7 +1774,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) break var/list/data = list( path = stocked_item, - name = initial(stocked_item.name), + name = itemname, price = price, img = base64, amount = vending_machine_input[stocked_item],