From 5cc7492f0abc42f866a82c260f54c3c9eb632c6c Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 9 Jan 2018 20:57:57 -0200 Subject: [PATCH 1/2] Merge pull request #34187 from ShizCalev/butcher-droplocation Switches butchering/gib drops to use drop_location --- code/modules/mob/living/carbon/alien/death.dm | 4 ++-- .../modules/mob/living/carbon/alien/larva/death.dm | 4 ++-- code/modules/mob/living/carbon/death.dm | 10 ++++++---- code/modules/mob/living/carbon/human/death.dm | 4 ++-- code/modules/mob/living/death.dm | 2 +- code/modules/mob/living/living.dm | 3 ++- code/modules/mob/living/silicon/death.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 3 ++- code/modules/surgery/bodyparts/dismemberment.dm | 14 +++++++------- 9 files changed, 25 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/death.dm b/code/modules/mob/living/carbon/alien/death.dm index a31dba9fa9..ce2b4401e9 100644 --- a/code/modules/mob/living/carbon/alien/death.dm +++ b/code/modules/mob/living/carbon/alien/death.dm @@ -1,8 +1,8 @@ /mob/living/carbon/alien/spawn_gibs(with_bodyparts) if(with_bodyparts) - new /obj/effect/gibspawner/xeno(get_turf(src)) + new /obj/effect/gibspawner/xeno(drop_location()) else - new /obj/effect/gibspawner/xenobodypartless(get_turf(src)) + new /obj/effect/gibspawner/xenobodypartless(drop_location()) /mob/living/carbon/alien/gib_animation() new /obj/effect/temp_visual/gib_animation(loc, "gibbed-a") diff --git a/code/modules/mob/living/carbon/alien/larva/death.dm b/code/modules/mob/living/carbon/alien/larva/death.dm index f49e545dfa..e16be71ccf 100644 --- a/code/modules/mob/living/carbon/alien/larva/death.dm +++ b/code/modules/mob/living/carbon/alien/larva/death.dm @@ -8,9 +8,9 @@ /mob/living/carbon/alien/larva/spawn_gibs(with_bodyparts) if(with_bodyparts) - new /obj/effect/gibspawner/larva(get_turf(src)) + new /obj/effect/gibspawner/larva(drop_location()) else - new /obj/effect/gibspawner/larvabodypartless(get_turf(src)) + new /obj/effect/gibspawner/larvabodypartless(drop_location()) /mob/living/carbon/alien/larva/gib_animation() new /obj/effect/temp_visual/gib_animation(loc, "gibbed-l") diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index 1deeaeeb17..082207ccf9 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -13,14 +13,16 @@ SSticker.mode.check_win() //Calls the rounds wincheck, mainly for wizard, malf, and changeling now /mob/living/carbon/gib(no_brain, no_organs, no_bodyparts) + var/atom/Tsec = drop_location() for(var/mob/M in src) if(M in stomach_contents) stomach_contents.Remove(M) - M.forceMove(loc) + M.forceMove(Tsec) visible_message("[M] bursts out of [src]!") ..() /mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts) + var/atom/Tsec = drop_location() if(!no_bodyparts) if(no_organs)//so the organs don't get transfered inside the bodyparts we'll drop. for(var/X in internal_organs) @@ -35,7 +37,7 @@ var/org_zone = check_zone(O.zone) //both groin and chest organs. if(org_zone == "chest") O.Remove(src) - O.forceMove(get_turf(src)) + O.forceMove(Tsec) O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) else for(var/X in internal_organs) @@ -47,7 +49,7 @@ qdel(I) continue I.Remove(src) - I.forceMove(get_turf(src)) + I.forceMove(Tsec) I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) @@ -55,4 +57,4 @@ for(var/X in bodyparts) var/obj/item/bodypart/BP = X BP.drop_limb() - BP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) \ No newline at end of file + BP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 95788da39d..83006e59b0 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -6,9 +6,9 @@ /mob/living/carbon/human/spawn_gibs(with_bodyparts) if(with_bodyparts) - new /obj/effect/gibspawner/human(get_turf(src), dna, get_static_viruses()) + new /obj/effect/gibspawner/human(drop_location(), dna, get_static_viruses()) else - new /obj/effect/gibspawner/humanbodypartless(get_turf(src), dna, get_static_viruses()) + new /obj/effect/gibspawner/humanbodypartless(drop_location(), dna, get_static_viruses()) /mob/living/carbon/human/spawn_dust(just_ash = FALSE) if(just_ash) diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 5f50b7adee..013e140a7f 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -18,7 +18,7 @@ return /mob/living/proc/spawn_gibs() - new /obj/effect/gibspawner/generic(get_turf(src), null, get_static_viruses()) + new /obj/effect/gibspawner/generic(drop_location(), null, get_static_viruses()) /mob/living/proc/spill_organs() return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 1c1870eb05..2afbabef85 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -789,9 +789,10 @@ if(QDELETED(src)) return if(butcher_results) + var/atom/Tsec = drop_location() for(var/path in butcher_results) for(var/i = 1; i <= butcher_results[path];i++) - new path(src.loc) + new path(Tsec) butcher_results.Remove(path) //In case you want to have things like simple_animals drop their butcher results on gib, so it won't double up below. visible_message("[user] butchers [src].") gib(0, 0, 1) diff --git a/code/modules/mob/living/silicon/death.dm b/code/modules/mob/living/silicon/death.dm index 2e1adb1959..8ecacb608b 100644 --- a/code/modules/mob/living/silicon/death.dm +++ b/code/modules/mob/living/silicon/death.dm @@ -1,5 +1,5 @@ /mob/living/silicon/spawn_gibs() - new /obj/effect/gibspawner/robot(get_turf(src)) + new /obj/effect/gibspawner/robot(drop_location()) /mob/living/silicon/spawn_dust() new /obj/effect/decal/remains/robot(loc) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 76c8de7bcc..5eb04e688c 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -247,9 +247,10 @@ /mob/living/simple_animal/gib() if(butcher_results) + var/atom/Tsec = drop_location() for(var/path in butcher_results) for(var/i = 1; i <= butcher_results[path];i++) - new path(src.loc) + new path(Tsec) ..() /mob/living/simple_animal/gib_animation() diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 63b955a571..10f2d182fe 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -82,7 +82,7 @@ /obj/item/bodypart/proc/drop_limb(special) if(!owner) return - var/turf/T = get_turf(owner) + var/atom/Tsec = owner.drop_location() var/mob/living/carbon/C = owner update_limb(1) C.bodyparts -= src @@ -126,7 +126,7 @@ C.update_hair() C.update_canmove() - if(!T) // T = null happens when a "dummy human" used for rendering icons on prefs screen gets its limbs replaced. + if(!Tsec) // Tsec = null happens when a "dummy human" used for rendering icons on prefs screen gets its limbs replaced. qdel(src) return @@ -135,7 +135,7 @@ qdel(src) return - forceMove(T) + forceMove(Tsec) @@ -167,7 +167,7 @@ ..() if(C && !special) if(C.handcuffed) - C.handcuffed.forceMove(C.loc) + C.handcuffed.forceMove(drop_location()) C.handcuffed.dropped(C) C.handcuffed = null C.update_handcuffed() @@ -185,7 +185,7 @@ ..() if(C && !special) if(C.handcuffed) - C.handcuffed.forceMove(C.loc) + C.handcuffed.forceMove(drop_location()) C.handcuffed.dropped(C) C.handcuffed = null C.update_handcuffed() @@ -201,7 +201,7 @@ /obj/item/bodypart/r_leg/drop_limb(special) if(owner && !special) if(owner.legcuffed) - owner.legcuffed.forceMove(owner.loc) + owner.legcuffed.forceMove(drop_location()) owner.legcuffed.dropped(owner) owner.legcuffed = null owner.update_inv_legcuffed() @@ -212,7 +212,7 @@ /obj/item/bodypart/l_leg/drop_limb(special) //copypasta if(owner && !special) if(owner.legcuffed) - owner.legcuffed.forceMove(owner.loc) + owner.legcuffed.forceMove(drop_location()) owner.legcuffed.dropped(owner) owner.legcuffed = null owner.update_inv_legcuffed()