Fixes custom vendor not sanitizing item names (#94191)

## About The Pull Request
- Fixes
https://github.com/tgstation/tgstation/pull/91987#issuecomment-3573314355

Strings such as `\improper` and other non alphanumeric characters that
are stripped out when sent to the UI are now discarded so we don't end
up with malformed hashes

## Changelog
🆑
fix: items such as dna injectors and others that have strange characters
in their names can now be dispensed from custom vending machines
/🆑
This commit is contained in:
SyncIt21
2025-11-28 13:19:09 +01:00
committed by GitHub
parent 4a47ddcd26
commit db5e36e7b4
+2 -4
View File
@@ -1,5 +1,5 @@
///This unique key decides how items are stacked on the UI. We separate them based on name,price & type
#define ITEM_HASH(item)("[item.name][item.custom_price][item.type]")
///This unique key decides how items are stacked on the UI. We separate them based on name, price & type
#define ITEM_HASH(item)(sanitize_css_class_name("[item.name][item.custom_price][item.type]"))
/obj/machinery/vending/custom
name = "Custom Vendor"
@@ -275,8 +275,6 @@
if(ITEM_HASH(product) == dispensed_item)
dispensed_item = product
break
if(QDELETED(dispensed_item))
return
var/obj/item/card/id/id_card = user.get_idcard(TRUE)
if(QDELETED(id_card))