Fix buckling and probably a lot more mousedrop interactions (#93352)

This commit is contained in:
MrMelbert
2025-10-08 11:47:52 +02:00
committed by GitHub
parent cf7d5b1e7b
commit e83fd2603f
4 changed files with 43 additions and 2 deletions
+1
View File
@@ -110,6 +110,7 @@
#include "blindness.dm"
#include "bloody_footprints.dm"
#include "breath.dm"
#include "buckle.dm"
#include "burning.dm"
#include "cable_powernets.dm"
#include "can_see.dm"
+36
View File
@@ -0,0 +1,36 @@
/// Test you can buckle yourself to a chair
/datum/unit_test/buckling_self
/datum/unit_test/buckling_self/Run()
var/mob/living/carbon/human/consistent/dummy = EASY_ALLOCATE()
dummy.mock_client = new()
var/obj/structure/chair/chair = EASY_ALLOCATE()
var/old_usr = usr
usr = dummy // mouse drop still uses usr
dummy.MouseDrop(chair)
if(dummy.buckled != chair)
TEST_FAIL("The dummy failed to buckle themselves to a chair via mouse drop.")
usr = old_usr
/// Test you can buckle someone else to a chair
/datum/unit_test/buckling_others
/datum/unit_test/buckling_others/Run()
var/mob/living/carbon/human/consistent/dummy = EASY_ALLOCATE()
dummy.mock_client = new()
var/mob/living/carbon/human/consistent/victim = EASY_ALLOCATE()
var/obj/structure/chair/chair = EASY_ALLOCATE()
var/old_usr = usr
usr = dummy // mouse drop still uses usr
victim.MouseDrop(chair)
if(victim.buckled != chair)
TEST_FAIL("The dummy failed to buckle the victim to a chair via mouse drop.")
usr = old_usr