From 72f65a06b6d5b7410b5d1d87cfbee1a45954095d Mon Sep 17 00:00:00 2001 From: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Date: Tue, 24 Mar 2026 10:58:21 -0400 Subject: [PATCH] Vended glasses in the Beach Bar virtual domain count towards domain completion when drank (#95466) ## About The Pull Request Previously, when one drank out of a glass of booze that the virtual bartender graciously offered, one would not get any closer to domain completion, because said bartender got his glasses new out of a vending machine. These glasses never were registered on domain creation, due to not existing on domain creation. This pr registers the vending machines within the domain with a new signal that allows newly created glasses to also be registered, and count towards domain completion. ## Why It's Good For The Game A bitrunner dying of liver failure due to the obtuse distinction between glasses that were in a vending machine and glasses that were on the table sounds very annoying. Also, you could very easily make the domain not completable within seconds by spawning as a ghostrole and breaking the table glasses. You can still do that, but you have to break an entire vending machine's worth of glasses too. ## Changelog :cl: fix: Glasses that were in the vending machine now still count for the completion of the Beach Bar virtual domain /:cl: --- code/__DEFINES/dcs/signals/signals_object.dm | 3 +++ .../bitrunning/virtual_domain/domains/beach_bar.dm | 8 ++++++++ code/modules/vending/vendor/inventory.dm | 2 ++ 3 files changed, 13 insertions(+) diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index 319e933cd07..dd75bf32ba1 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -666,5 +666,8 @@ #define COMSIG_VENDING_UI_INTERACT "vending_ui_interact" #define VENDING_DENIED (1<<0) +/// From /obj/machinery/vending/dispense(): (obj/item/vended_item) +#define COMSIG_VENDING_DISPENSED "vending_dispensed" + /// Sent from /datum/component/reflection when the reflection is updated to the mob reflecting: (atom/movable/reflecting_in, obj/effect/abstract/reflection) #define COMSIG_REFLECTION_UPDATED "reflection_updated" diff --git a/code/modules/bitrunning/virtual_domain/domains/beach_bar.dm b/code/modules/bitrunning/virtual_domain/domains/beach_bar.dm index 5ae0793b6e9..12d6becc136 100644 --- a/code/modules/bitrunning/virtual_domain/domains/beach_bar.dm +++ b/code/modules/bitrunning/virtual_domain/domains/beach_bar.dm @@ -13,6 +13,14 @@ for(var/obj/item/reagent_containers/cup/glass/drink in created_atoms) RegisterSignal(drink, COMSIG_GLASS_DRANK, PROC_REF(on_drink_drank)) + for(var/obj/machinery/vending/vending_machine in created_atoms) + RegisterSignal(vending_machine, COMSIG_VENDING_DISPENSED, PROC_REF(on_vended_item)) + + +/datum/lazy_template/virtual_domain/beach_bar/proc/on_vended_item(obj/machinery/vending/vending_machine, obj/item/vended_item) + if(istype(vended_item, /obj/item/reagent_containers/cup/glass)) + RegisterSignal(vended_item, COMSIG_GLASS_DRANK, PROC_REF(on_drink_drank)) + /// Eventually reveal the cache /datum/lazy_template/virtual_domain/beach_bar/proc/on_drink_drank(datum/source) diff --git a/code/modules/vending/vendor/inventory.dm b/code/modules/vending/vendor/inventory.dm index 68b028d607b..26a9337581a 100644 --- a/code/modules/vending/vendor/inventory.dm +++ b/code/modules/vending/vendor/inventory.dm @@ -239,6 +239,8 @@ on_dispense(vended_item, dispense_returned) use_energy(active_power_usage) + SEND_SIGNAL(src, COMSIG_VENDING_DISPENSED, vended_item) + return vended_item /**