Merge pull request #3710 from CHOMPStation2/upstream-merge-12281

[MIRROR] Unbuckle mobs when morphs take control
This commit is contained in:
Razgriz
2022-02-18 22:36:24 -07:00
committed by GitHub

View File

@@ -282,6 +282,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)
@@ -326,6 +341,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))