From 52c44100f4f2467eb8901a5fab8b9c05d97838e7 Mon Sep 17 00:00:00 2001 From: Fira Date: Tue, 5 Dec 2023 20:36:27 +0000 Subject: [PATCH 1/3] debug --- code/game/atoms_movable.dm | 1 + code/modules/mob/living/carbon/xenomorph/Xenomorph.dm | 3 +++ code/modules/mob/living/living.dm | 5 +++++ code/modules/mob/mob.dm | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 21f7b6b0a9be..12b7920aaa62 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -9,6 +9,7 @@ var/throw_range = 7 var/cur_speed = MIN_SPEED // Current speed of an atom (account for speed when launched/thrown as well) var/mob/pulledby = null + var/debug_pulledby_warned = FALSE var/rebounds = FALSE var/rebounding = FALSE // whether an object that was launched was rebounded (to prevent infinite recursive loops from wall bouncing) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index cc0065733e21..58a3672c7064 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -766,6 +766,9 @@ /mob/living/carbon/xenomorph/resist_grab(moving_resist) if(!pulledby) return + if(pulledby && pulledby?.pulling != pulledby && !debug_pulledby_warned) + debug_pulledby_warned = TRUE + debug_pulledby() if(pulledby.grab_level) visible_message(SPAN_DANGER("[src] has broken free of [pulledby]'s grip!"), null, null, 5) pulledby.stop_pulling() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 6205c4f919a4..80fdda6630d9 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -215,6 +215,9 @@ /mob/living/resist_grab(moving_resist) if(!pulledby) return + if(pulledby && pulledby?.pulling != pulledby && !debug_pulledby_warned) + debug_pulledby_warned = TRUE + debug_pulledby() if(pulledby.grab_level) if(prob(50)) playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) @@ -228,6 +231,8 @@ pulledby.stop_pulling() return 1 +/mob/proc/debug_pulledby() + log_debug("PULLEDBY: Improper pulling relationship between pullee \[[src.name] (type:[src.type]) @ \ref[src]\] [ADMIN_VV(src)] and would-be puller \[[src.pulledby?.name] (type:[src.pulledby?.type]) @ \ref[src.pulledby]\] [ADMIN_VV(src.pulledby)]") /mob/living/movement_delay() . = ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index c256f05e74b4..5c231cf969e5 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -542,9 +542,9 @@ return else if(istype(AM, /obj)) AM.add_fingerprint(src) - pulling = AM AM.pulledby = src + AM.debug_pulledby_warned = FALSE var/obj/item/grab/G = new /obj/item/grab() G.grabbed_thing = AM From fa734a27ab8c8d67ef02dca29db43248e056b434 Mon Sep 17 00:00:00 2001 From: Fira Date: Tue, 5 Dec 2023 20:38:48 +0000 Subject: [PATCH 2/3] oops --- code/modules/mob/living/carbon/xenomorph/Xenomorph.dm | 2 +- code/modules/mob/living/living.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 58a3672c7064..5487cee31bd2 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -766,7 +766,7 @@ /mob/living/carbon/xenomorph/resist_grab(moving_resist) if(!pulledby) return - if(pulledby && pulledby?.pulling != pulledby && !debug_pulledby_warned) + if(pulledby && pulledby?.pulling != src && !debug_pulledby_warned) debug_pulledby_warned = TRUE debug_pulledby() if(pulledby.grab_level) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 80fdda6630d9..1f8fad894d3e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -215,7 +215,7 @@ /mob/living/resist_grab(moving_resist) if(!pulledby) return - if(pulledby && pulledby?.pulling != pulledby && !debug_pulledby_warned) + if(pulledby && pulledby?.pulling != src && !debug_pulledby_warned) debug_pulledby_warned = TRUE debug_pulledby() if(pulledby.grab_level) From 0e4b35b44ded24e7aa917fd84fd957168e30d0ad Mon Sep 17 00:00:00 2001 From: Fira Date: Tue, 5 Dec 2023 20:45:53 +0000 Subject: [PATCH 3/3] safer default --- code/game/atoms_movable.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 12b7920aaa62..5abd44f3ed23 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -9,7 +9,7 @@ var/throw_range = 7 var/cur_speed = MIN_SPEED // Current speed of an atom (account for speed when launched/thrown as well) var/mob/pulledby = null - var/debug_pulledby_warned = FALSE + var/debug_pulledby_warned = TRUE var/rebounds = FALSE var/rebounding = FALSE // whether an object that was launched was rebounded (to prevent infinite recursive loops from wall bouncing)