Files
Bubberstation/code/modules/vending
SkyratBot 30b943f744 [MIRROR] Fixes duplicating space beer [MDB IGNORE] (#25796)
* Fixes duplicating space beer (#80500)

## About The Pull Request

Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/25760
Fixes https://github.com/tgstation/tgstation/issues/80271

I don't know if it was a result of the react port or not (likely it
was), but unexpected behavior occurs when multiple objects are mapped to
the same key.

In this case, there were two items named 'Space Beer', so in order to
have unique keys I've changed it so that they're keyed to the path
instead of the name.

Shown below, the two types of beer:

![b2SS6BiIf4](https://github.com/tgstation/tgstation/assets/13398309/914748a2-552d-4bcb-a3cc-3fd27e0ef4ba)

<details><summary>Beer duplicating when switching tabs</summary>

![Kvm7Y0cEM8](https://github.com/tgstation/tgstation/assets/13398309/0f8ffd49-b954-411c-acd3-17b7e34f024c)
</details>

<details><summary>No more of that</summary>

![8HRol9ywN9](https://github.com/tgstation/tgstation/assets/13398309/94111610-8f5c-482d-9f95-404ffe5ee565)

</details>

edit: also fixes a bug where buying an item with the same name as
another would decrement the stock of both items.

<details><summary>Fixed (see space beer)</summary>

![Ukkrr7ekNv](https://github.com/tgstation/tgstation/assets/13398309/d2ffa348-5696-4e73-8584-c4399608c635)

</details>

## Why It's Good For The Game

Fixes a bug

## Changelog

🆑
fix: the boozeomat ui will stop duplicating space beer bottles
refactor: refactored vending machine backend to have unique keys for
their data structures. should fix bugs related to items that happen to
have the same name.
/🆑

* Fixes duplicating space beer

* Fixing this mistake from a previous pr

* Update lustwish.dm

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-12-23 14:23:32 +00:00
..