From 0f069c1b63f4a23000747a67336ccd8f26dca55f Mon Sep 17 00:00:00 2001 From: VerySoft Date: Fri, 18 Feb 2022 22:54:09 -0500 Subject: [PATCH] Unbuckle mobs when morphs take control That way if someone's in a wheelchair or riding a taur they will not be pulled out of the inside of wherever they are when the thing they're buckled to moves. --- .../simple_mob/subtypes/vore/morph/morph.dm | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm index fa6d2b8314d..1622321c526 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm @@ -283,6 +283,21 @@ log_admin("[key_name_admin(src)] offered [M] to swap bodies as a morph.") if(tgui_alert(M, "\The [src] has elected to attempt to take over your body and control you. Is this something you will allow to happen?", "Allow Morph To Take Over",list("No","Yes")) == "Yes") if(tgui_alert(M, "Are you sure? The only way to undo this on your own is to OOC Escape.", "Allow Morph To Take Over",list("No","Yes")) == "Yes") + if(buckled) + buckled.unbuckle_mob() + if(M.buckled) + M.buckled.unbuckle_mob() + if(LAZYLEN(buckled_mobs)) + for(var/buckledmob in buckled_mobs) + riding_datum.force_dismount(buckledmob) + if(LAZYLEN(M.buckled_mobs)) + for(var/p_buckledmob in M.buckled_mobs) + M.riding_datum.force_dismount(p_buckledmob) + if(pulledby) + pulledby.stop_pulling() + if(M.pulledby) + M.pulledby.stop_pulling() + stop_pulling() original_ckey = ckey log_and_message_admins("[key_name_admin(src)] has swapped bodies with [key_name_admin(M)] as a morph at [get_area(src)] - [COORD(src)].") new /mob/living/simple_mob/vore/hostile/morph/dominated_prey(M.vore_selected, M.ckey, src, M) @@ -327,6 +342,22 @@ prey_body = null /mob/living/simple_mob/vore/hostile/morph/dominated_prey/proc/undo_prey_takeover(ooc_escape) + if(buckled) + buckled.unbuckle_mob() + if(prey_body.buckled) + prey_body.buckled.unbuckle_mob() + if(LAZYLEN(buckled_mobs)) + for(var/buckledmob in buckled_mobs) + riding_datum.force_dismount(buckledmob) + if(LAZYLEN(prey_body.buckled_mobs)) + for(var/p_buckledmob in prey_body.buckled_mobs) + prey_body.riding_datum.force_dismount(p_buckledmob) + if(pulledby) + pulledby.stop_pulling() + if(prey_body.pulledby) + prey_body.pulledby.stop_pulling() + stop_pulling() + if(ooc_escape) prey_body.forceMove(get_turf(src)) parent_morph.forceMove(get_turf(src))