diff --git a/code/datums/components/zombie_regen.dm b/code/datums/components/zombie_regen.dm index 561446571e3..546b98838fc 100644 --- a/code/datums/components/zombie_regen.dm +++ b/code/datums/components/zombie_regen.dm @@ -82,7 +82,7 @@ zomboid.suiciding = 0 zomboid.set_nutrition(max(zomboid.nutrition, NUTRITION_LEVEL_HUNGRY)) if(zomboid.buckled) //Unbuckle the mob and clear the alerts. - zomboid.buckled.unbuckle_mob(src, force = TRUE) + zomboid.unbuckle(force = TRUE) var/datum/organ/heart/heart = zomboid.get_int_organ_datum(ORGAN_DATUM_HEART) var/heart_type = zomboid.dna?.species?.has_organ["heart"] diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index dfb66d084f6..8f4aac056d2 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -140,7 +140,7 @@ destturf = safepick(posturfs) else destturf = get_turf(destination) - + // Make sure the target tile does not contain a teleporter on it for(var/teleporter_type in blacklisted) var/teleporters = destturf.search_contents_for(teleporter_type) @@ -167,7 +167,7 @@ if(isliving(teleatom)) var/mob/living/target_mob = teleatom if(target_mob.buckled) - target_mob.buckled.unbuckle_mob(target_mob, force = TRUE) + target_mob.unbuckle(force = TRUE) if(target_mob.has_buckled_mobs()) target_mob.unbuckle_all_mobs(force = TRUE) if(ismachinery(target_mob.loc) || istype(target_mob.loc, /obj/item/mecha_parts/mecha_equipment/medical/sleeper)) diff --git a/code/datums/spells/area_teleport.dm b/code/datums/spells/area_teleport.dm index 3cd160c1cc7..02a6ab326ef 100644 --- a/code/datums/spells/area_teleport.dm +++ b/code/datums/spells/area_teleport.dm @@ -54,7 +54,7 @@ return if(target && target.buckled) - target.buckled.unbuckle_mob(target, force = TRUE) + target.unbuckle(force = TRUE) if(target && target.has_buckled_mobs()) target.unbuckle_all_mobs(force = TRUE) diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index dda3f5cef56..c9e42b3434e 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -165,7 +165,7 @@ // No cheesing with buckling ourselves, this spinning is too fast for seatbelts if(user.buckled) - user.buckled.unbuckle_mob(user, force = TRUE) + user.unbuckle(force = TRUE) // Check if the machine and the user are still next to each other if(!do_after(user, delay = 1.2 SECONDS, target = src, use_default_checks = FALSE)) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 5a8a61cdeb0..258887a0c12 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -191,4 +191,4 @@ /mob/living/proc/check_buckled() if(buckled && !(buckled in loc)) - buckled.unbuckle_mob(src, force = TRUE) + unbuckle(force = TRUE) diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index eaa00d8e638..cd68290806c 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -36,7 +36,7 @@ user.visible_message("[user] cuts [C]'s restraints with [src]!") QDEL_NULL(C.handcuffed) if(C.buckled && C.buckled.buckle_requires_restraints) - C.buckled.unbuckle_mob(C) + C.unbuckle() C.update_handcuffed() return else diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm index a66919d4e77..4da6b3284ac 100644 --- a/code/game/objects/items/weapons/scrolls.dm +++ b/code/game/objects/items/weapons/scrolls.dm @@ -21,7 +21,7 @@ . += "Number of uses: [uses]. This scroll will vanish after the final use." . += "P.S. Don't forget to bring your gear, you'll need it to cast most spells." -/obj/item/teleportation_scroll/attack_self(mob/user) +/obj/item/teleportation_scroll/attack_self(mob/living/user) if(!uses) //somehow? to_chat(user, "You attempt to read the scroll but it disintegrates in your hand, it appears that is has run out of charges!") qdel(src) @@ -59,7 +59,7 @@ return if(user && user.buckled) - user.buckled.unbuckle_mob(user, force = TRUE) + user.unbuckle(force = TRUE) if(user?.has_buckled_mobs()) user.unbuckle_all_mobs(force = TRUE) diff --git a/code/modules/mob/living/carbon/carbon_procs.dm b/code/modules/mob/living/carbon/carbon_procs.dm index 2ae9495ff2e..f276e626313 100644 --- a/code/modules/mob/living/carbon/carbon_procs.dm +++ b/code/modules/mob/living/carbon/carbon_procs.dm @@ -733,7 +733,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven else if(I == handcuffed) handcuffed = null if(buckled && buckled.buckle_requires_restraints) - buckled.unbuckle_mob(src) + unbuckle() update_handcuffed() else if(I == legcuffed) legcuffed = null @@ -994,7 +994,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven handcuffed = null if(buckled && buckled.buckle_requires_restraints) - buckled.unbuckle_mob(src) + unbuckle() update_handcuffed() if(client) diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 26b07818d2d..69a4db2e47a 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -586,7 +586,7 @@ if(target.anchored) return FALSE if(target.buckled) - target.buckled.unbuckle_mob(target) + target.unbuckle() var/shove_dir = get_dir(user.loc, target.loc) var/turf/shove_to = get_step(target.loc, shove_dir) diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm index 478646c3288..5c04aef2795 100644 --- a/code/modules/mob/living/carbon/human/species/golem.dm +++ b/code/modules/mob/living/carbon/human/species/golem.dm @@ -454,7 +454,7 @@ if(!isturf(picked)) return if(H.buckled) - H.buckled.unbuckle_mob(H, force = TRUE) + H.unbuckle(force = TRUE) do_teleport(H, picked) return TRUE @@ -538,7 +538,7 @@ if(!isturf(picked)) return if(H.buckled) - H.buckled.unbuckle_mob(H, force = TRUE) + H.unbuckle(force = TRUE) do_teleport(H, picked) last_teleport = world.time UpdateButtons() //action icon looks unavailable diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 35de55ab7c7..46c9008e06d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -538,7 +538,7 @@ on_fire = 0 suiciding = 0 if(buckled) //Unbuckle the mob and clear the alerts. - buckled.unbuckle_mob(src, force = TRUE) + unbuckle(force = TRUE) if(iscarbon(src)) var/mob/living/carbon/C = src @@ -803,6 +803,10 @@ END RESIST PROCS */////////////////////// +/// Unbuckle the mob from whatever it is buckled to. +/mob/living/proc/unbuckle(force) + buckled.unbuckle_mob(src, force) + /mob/living/proc/Exhaust() to_chat(src, "You're too exhausted to keep going...") Weaken(10 SECONDS) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 27e41f391a2..2661102fef4 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -41,6 +41,9 @@ var/mob_biotypes = MOB_ORGANIC var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature.. + /// movable atom we are buckled to + var/atom/movable/buckling + var/ventcrawler = VENTCRAWLER_NONE var/list/icon/pipes_shown = list() var/last_played_vent diff --git a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm index dd33037817b..6f6144d44fa 100644 --- a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm +++ b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm @@ -316,7 +316,7 @@ if(T.density) forceMove(H.loc) if(H.buckled) - H.buckled.unbuckle_mob(H, force = TRUE) + H.unbuckle(force = TRUE) manifested = TRUE Manifest() to_chat(H, "You feel the floor closing in on your feet!") diff --git a/code/modules/mob/living/simple_animal/slime/slime_powers.dm b/code/modules/mob/living/simple_animal/slime/slime_powers.dm index f933d338870..1fef3f12c22 100644 --- a/code/modules/mob/living/simple_animal/slime/slime_powers.dm +++ b/code/modules/mob/living/simple_animal/slime/slime_powers.dm @@ -118,7 +118,7 @@ visible_message("[src] has let go of [buckled]!", \ "I stopped feeding.") layer = initial(layer) - buckled.unbuckle_mob(src,force=TRUE) + unbuckle(force=TRUE) /mob/living/simple_animal/slime/proc/Evolve() if(stat) diff --git a/code/modules/mob/mob_vars.dm b/code/modules/mob/mob_vars.dm index 627a6bad072..eb1416b550b 100644 --- a/code/modules/mob/mob_vars.dm +++ b/code/modules/mob/mob_vars.dm @@ -75,8 +75,6 @@ var/lastKnownIP = null /// movable atoms buckled to this mob var/atom/movable/buckled = null //Living - /// movable atom we are buckled to - var/atom/movable/buckling var/obj/item/l_hand = null //Living var/obj/item/r_hand = null //Living diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 2a0827d75a1..3ed8d1d32dc 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -482,12 +482,12 @@ if(globalMalf > 16 && globalMalf < 35) visible_message("[src] melts [exp_on], ian-izing the air around it!") throwSmoke(loc) - var/mob/tracked_ian = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_living_list + var/mob/living/tracked_ian = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_living_list if(tracked_ian) throwSmoke(tracked_ian.loc) tracked_ian.loc = loc if(tracked_ian.buckled) - tracked_ian.buckled.unbuckle_mob(tracked_ian, TRUE) + tracked_ian.unbuckle(force = TRUE) investigate_log("Experimentor has stolen Ian!", "experimentor") //...if anyone ever fixes it... else new /mob/living/simple_animal/pet/dog/corgi(loc) @@ -496,12 +496,12 @@ if(globalMalf > 36 && globalMalf < 59) visible_message("[src] encounters a run-time error!") throwSmoke(loc) - var/mob/tracked_runtime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_living_list + var/mob/living/tracked_runtime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_living_list if(tracked_runtime) throwSmoke(tracked_runtime.loc) tracked_runtime.loc = loc if(tracked_runtime.buckled) - tracked_runtime.buckled.unbuckle_mob(tracked_runtime, TRUE) + tracked_runtime.unbuckle(force = TRUE) investigate_log("Experimentor has stolen Runtime!", "experimentor") else new /mob/living/simple_animal/pet/cat(loc) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index a1884926050..35ae17be544 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -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("[L] is hit by \ - a hyperspace ripple!", - "You feel an immense \ - crushing pressure as the space around you ripples.") - 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("[L] is hit by \ + a hyperspace ripple!", + "You feel an immense \ + crushing pressure as the space around you ripples.") + L.gib() else if(lance_docking) //corrupt the child, destroy them all if(!AM.simulated) continue diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index 1f2a0d1603c..3febb344884 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -433,7 +433,7 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby")) for(var/V in listeners) var/mob/living/L = V if(L.buckled && istype(L.buckled, /obj/structure/chair)) - L.buckled.unbuckle_mob(L) + L.unbuckle() next_command = world.time + cooldown_meme //DANCE