[REFACTOR] Helper proc for unbuckling a mob (#26918)

* Helper proc from unbuckling a mob

* Rename to unbuckle

* Minor fixes

* Move buckled up /mob/living

---------

Co-authored-by: Adrer <adrermail@gmail.com>
This commit is contained in:
Chap
2024-10-10 14:54:09 +02:00
committed by GitHub
parent 7ed4ef4f76
commit a060093b59
18 changed files with 41 additions and 38 deletions
+12 -14
View File
@@ -645,20 +645,18 @@
var/obj/mecha/mech = AM
if(mech.occupant)
INVOKE_ASYNC(mech, TYPE_PROC_REF(/obj/mecha, get_out_and_die))
if(ismob(AM))
var/mob/M = AM
if(M.buckled)
M.buckled.unbuckle_mob(M, force = TRUE)
if(isliving(AM))
var/mob/living/L = AM
if(L.incorporeal_move || L.status_flags & GODMODE)
continue
L.stop_pulling()
L.visible_message("<span class='warning'>[L] is hit by \
a hyperspace ripple!</span>",
"<span class='userdanger'>You feel an immense \
crushing pressure as the space around you ripples.</span>")
L.gib()
if(isliving(AM))
var/mob/living/L = AM
if(L.buckled)
L.unbuckle(force = TRUE)
if(L.incorporeal_move || L.status_flags & GODMODE)
continue
L.stop_pulling()
L.visible_message("<span class='warning'>[L] is hit by \
a hyperspace ripple!</span>",
"<span class='userdanger'>You feel an immense \
crushing pressure as the space around you ripples.</span>")
L.gib()
else if(lance_docking) //corrupt the child, destroy them all
if(!AM.simulated)
continue