Files
Bubberstation/code/modules/unit_tests/unequip_defib.dm
MrMelbert da10322dc1 Fix modsuits and defibs (#93373)
## About The Pull Request

Fixes #93359

Caused by #93165

Inventory screen elements were no longer considered reachable, which
broke mousedrop handing on objects that check "is dragging into
inventory slot"

I don't know the best way to fix this yet but I figured the next best
thing would be to make all of these use the `drag_pickup` element, which
skips this reach-ability check

Thus I refactored it slightly to accommodate for items which should
contextually not be drag-pick-up-abble and bam, works like a charm

## Changelog

🆑 Melbert
fix: Dragging defibs and modsuits off your back works again
/🆑

---------

Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Xander3359 <66163761+Xander3359@users.noreply.github.com>
2025-10-11 18:17:23 -04:00

20 lines
610 B
Plaintext

/// Test you can mouse-drop a defib off your back to unequip it
/datum/unit_test/unequip_defib
/datum/unit_test/unequip_defib/Run()
var/mob/living/carbon/human/consistent/dummy = EASY_ALLOCATE()
dummy.mock_client = new()
dummy.set_hud_used(new dummy.hud_type(dummy))
var/obj/item/defibrillator/defib = EASY_ALLOCATE()
dummy.equip_to_slot(defib, ITEM_SLOT_BACK)
var/old_usr = usr
usr = dummy // mouse drop still uses usr
defib.MouseDrop(dummy.hud_used.hand_slots["1"])
if(!dummy.is_holding(defib))
TEST_FAIL("The dummy failed to remove the defib from their back via mouse drop.")
usr = old_usr