Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEBUG: src.pulledby.pulling == src #5134

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 = TRUE
var/rebounds = FALSE
var/rebounding = FALSE // whether an object that was launched was rebounded (to prevent infinite recursive loops from wall bouncing)

Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/Xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,9 @@
/mob/living/carbon/xenomorph/resist_grab(moving_resist)
if(!pulledby)
return
if(pulledby && pulledby?.pulling != src && !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()
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@
/mob/living/resist_grab(moving_resist)
if(!pulledby)
return
if(pulledby && pulledby?.pulling != src && !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)
Expand All @@ -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()
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down