From 7c6bbe328e7e7e6add2b80468eaa76132eff02d1 Mon Sep 17 00:00:00 2001 From: phil235 Date: Mon, 12 Oct 2015 23:28:48 +0200 Subject: [PATCH] Fixes some cases with mobs attached a mob. Can't enter a mech if attachment is done mid-climb. Can't get inside mech sleeper or closet if you have a mob attached to you. All sorts of teleports now properly teleport the attached mob as well. Changed the warning message when climbing mech with a mob attached to be more general instead of specifically about slimes. Getting inside a closet or machine now immediately breaks your pull and the pull of your puller. Using ethereal jaunt now also immediately break your pull. Fixes being able to get inside a mech sleeper while buckled by buckling mid-insertion. --- code/datums/spells/ethereal_jaunt.dm | 3 +++ code/datums/spells/turf_teleport.dm | 4 ++++ code/game/machinery/machinery.dm | 4 +++- .../mecha/equipment/tools/medical_tools.dm | 24 +++++++++++-------- code/game/mecha/mecha.dm | 8 ++++--- .../structures/crates_lockers/closets.dm | 5 +++- code/modules/admin/verbs/adminjump.dm | 4 ++++ 7 files changed, 37 insertions(+), 15 deletions(-) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 9a360ea0bd3..d86dbcaf175 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -34,6 +34,9 @@ target.buckled.unbuckle_mob() if(target.pulledby) target.pulledby.stop_pulling() + target.stop_pulling() + if(target.buckled_mob) + target.unbuckle_mob(force=1) jaunt_disappear(animation, target) target.loc = holder target.notransform=0 //mob is safely inside holder now, no need for protection. diff --git a/code/datums/spells/turf_teleport.dm b/code/datums/spells/turf_teleport.dm index 7f8832ed436..1d2b47f11c0 100644 --- a/code/datums/spells/turf_teleport.dm +++ b/code/datums/spells/turf_teleport.dm @@ -36,5 +36,9 @@ return if(!target.Move(picked)) + if(target.buckled) + target.buckled.unbuckle_mob() + if(target.buckled_mob) + target.unbuckle_mob(force=1) target.loc = picked playsound(get_turf(usr), sound2, 50,1) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 92645d94d87..7c6d2062ff5 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -183,13 +183,15 @@ Class Procs: continue else target = C - if(target) + if(target && !target.buckled && !target.buckled_mob) if(target.client) target.client.perspective = EYE_PERSPECTIVE target.client.eye = src occupant = target target.loc = src target.stop_pulling() + if(target.pulledby) + target.pulledby.stop_pulling() updateUsrDialog() update_icon() diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index a7ee3ead1b8..827a258508e 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -42,20 +42,12 @@ return if(!istype(target)) return - if(target.buckled) - occupant_message("[target] will not fit into the sleeper because they are buckled to [target.buckled]!") - return - if(patient) - occupant_message("The sleeper is already occupied!") - return - if(target.buckled_mob) //slime attached to them - occupant_message("[target] will not fit into the sleeper because they have a slime latched onto their head!") + if(!patient_insertion_check(target)) return occupant_message("You start putting [target] into [src]...") chassis.visible_message("[chassis] starts putting [target] into \the [src].") if(do_after_cooldown(target)) - if(patient) - occupant_message("The sleeper is already occupied!") + if(!patient_insertion_check(target)) return target.forceMove(src) patient = target @@ -66,6 +58,18 @@ chassis.visible_message("[chassis] loads [target] into [src].") log_message("[target] loaded. Life support functions engaged.") +/obj/item/mecha_parts/mecha_equipment/sleeper/proc/patient_insertion_check(mob/living/carbon/target) + if(target.buckled) + occupant_message("[target] will not fit into the sleeper because they are buckled to [target.buckled]!") + return + if(target.buckled_mob) + occupant_message("[target] will not fit into the sleeper because [target.buckled_mob] is attached to it!") + return + if(patient) + occupant_message("The sleeper is already occupied!") + return + return 1 + /obj/item/mecha_parts/mecha_equipment/sleeper/proc/go_out() if(!patient) return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index ad942a8ba65..cb2fdf03c96 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -668,8 +668,8 @@ user << "You are currently buckled and cannot move." log_append_to_last("Permission denied.") return - if(user.buckled_mob) //slime attached to us - user << "You're too busy getting your life sucked out of you!" + if(user.buckled_mob) //mob attached to us + user << "You can't enter the exosuit with [user.buckled_mob] attached to you!" return visible_message("[user] starts to climb into [src.name].") @@ -680,7 +680,9 @@ else if(occupant) user << "[src.occupant] was faster! Try better next time, loser." else if(user.buckled) - user << "You have been buckled and cannot move." + user << "You can't enter the exosuit while buckled." + else if(user.buckled_mob) + user << "You can't enter the exosuit with [user.buckled_mob] attached to you." else moved_inside(user) else diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 8ee70dbe07d..361c29ba0cb 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -122,7 +122,7 @@ if(istype(AM, /mob/living)) var/mob/living/L = AM - if(L.buckled || L.buckled_mob || L.mob_size > max_mob_size) //buckled mobs and mobs too big for the container don't get inside closets. + if(L.buckled || L.buckled_mob || L.mob_size > max_mob_size) //buckled mobs, mobs with another mob attached, and mobs too big for the container don't get inside closets. return 0 if(L.mob_size > MOB_SIZE_TINY) //decently sized mobs take more space than objects. var/mobs_stored = 0 @@ -133,6 +133,7 @@ if(L.client) L.client.perspective = EYE_PERSPECTIVE L.client.eye = src + L.stop_pulling() else if(!istype(AM, /obj/item) && !istype(AM, /obj/effect/dummy/chameleon)) return 0 else if(AM.density || AM.anchored) @@ -140,6 +141,8 @@ else if(AM.flags & NODROP) return 0 AM.loc = src + if(AM.pulledby) + AM.pulledby.stop_pulling() return 1 /obj/structure/closet/proc/close() diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 6b3040a1677..a1c4cce58f7 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -149,6 +149,10 @@ message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]") /proc/admin_forcemove(mob/mover, atom/newloc) + if(mover.buckled) + mover.buckled.unbuckle_mob() + if(mover.buckled_mob) + mover.unbuckle_mob(force=1) mover.loc = newloc mover.on_forcemove(newloc)