Files
Bubberstation/code/modules/vending
SyncIt21 2d41569c65 Flatpacker & machine frame enhancements (#91752)
## About The Pull Request

**1. Makes the machine creation process from both efficient.**
The machine frame no longer creates & deletes the machines old component
parts before moving in the new parts. It instead now passes its parts
directly to the circuit boards `apply_default_parts()` meaning the old
parts are never created and the new ones get applied directly. This also
mean it does not have to again call `RefreshParts()` as the machines
`Initialize()` proc will do that for us by default so the performance is
just faster now.
Flatpack box also benefits from this and it will need it as stated below

- Fixes #86514. As the circuit board is passed to the machine's
`Initialize()` proc during reconstruction so it sets it's
`all_products_free` from the board both during mapload & when player
constructed from either machine frame & flatpack

**2. Flatpack enhancements** 
- The flatpack box now passes its stored circuit board into the machine
meaning any changes made like with a screw driver or such are preserved
in the newly created machine rather than the board getting deleted & the
machine creating the default board
- Flatpacker now accept custom component parts that replaces its stored
circuit board default parts. This implements

https://github.com/tgstation/tgstation/pull/91670#issuecomment-2977259973
meaning instead of the vendor created from the flatpacker starting out
empty it now accepts the refill canister and will package both of them
together. Then during deployment that stored canister is stored back in
the vendor meaning instead of starting out empty you get to carry over
all your previous stock

Depends on https://github.com/tgstation/tgstation/pull/91512 because of
named arg conflict. Keep this drafted till that gets merged

## Changelog
🆑
qol: flatpacker now accepts custom component parts(like vendor refill
canister) along with the circuit board so you can carry over your
previous stock during deployment rather than starting out empty
fix: flatpack boxes now passes its stored circuit board into the machine
thus preserving its properties instead of creating a default board in
the machine
fix: vending machines reconstructed on station from circuits loaded off
station(having free products) will continue to sell free products
code: machine construction via flatpacker/machine frame is faster
performance wise
/🆑
2025-07-11 08:58:11 +02:00
..
2025-06-15 16:50:16 +10:00