From 5cf13a34bb88242607d51c14b7ad13ac6dd5dfae Mon Sep 17 00:00:00 2001 From: Veth-s Date: Tue, 4 Feb 2025 23:36:30 +0000 Subject: [PATCH] Blacklists money from interaction component (#5293) ## About The Pull Request Fixes #5245, #5262. Disables money from being placed within an interaction component, fixing a money dupe. ## Changelog :cl: fix: Fixes a money dupe by blacklisting spacecash and monkecoin from interaction components. /:cl: --------- Co-authored-by: Lucy --- .../code/modules/mech_comp/objects/interactor.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/monkestation/code/modules/mech_comp/objects/interactor.dm b/monkestation/code/modules/mech_comp/objects/interactor.dm index 4af0794c9607..e1b26bf17b1d 100644 --- a/monkestation/code/modules/mech_comp/objects/interactor.dm +++ b/monkestation/code/modules/mech_comp/objects/interactor.dm @@ -18,6 +18,12 @@ var/stored_dir = NORTH ///the interaction range defaults to ontop of itself var/range = FALSE + /// Typecache of items forbidden from being held and used by the component. + var/static/list/item_blacklist = typecacheof(list( + /obj/item/stack/spacecash, + /obj/item/stack/monkecoin, + /obj/item/holochip, + )) /obj/item/mcobject/interactor/Initialize(mapload) . = ..() @@ -166,6 +172,9 @@ else held_item.forceMove(drop_location()) held_item = null + if(is_type_in_typecache(weapon, item_blacklist)) + say("[weapon] is incompatible with the interaction component!") + return held_item = weapon dummy_human.put_in_l_hand(weapon) update_appearance()