Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Dec 5, 2023
1 parent 35f3406 commit 52c4410
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
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 = FALSE
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 != 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()
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 != 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)
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

0 comments on commit 52c4410

Please sign in to comment.