diff --git a/code/modules/mob/living/butchering.dm b/code/modules/mob/living/butchering.dm index 514475e2a2..b46abcac01 100644 --- a/code/modules/mob/living/butchering.dm +++ b/code/modules/mob/living/butchering.dm @@ -43,6 +43,21 @@ if(LAZYLEN(organs)) organs_by_name.Cut() + for(var/path in organs) + if(ispath(path)) + var/obj/item/organ/external/neworg = new path(src) + neworg.name = "[name] [neworg.name]" + neworg.meat_type = meat_type + + if(istype(src, /mob/living/simple_mob)) + var/mob/living/simple_mob/SM = src + if(SM.limb_icon) + neworg.force_icon = SM.limb_icon + neworg.force_icon_key = SM.limb_icon_key + + organs |= neworg + organs -= path + for(var/obj/item/organ/OR in organs) OR.removed() organs -= OR @@ -50,6 +65,14 @@ if(LAZYLEN(internal_organs)) internal_organs_by_name.Cut() + for(var/path in internal_organs) + if(ispath(path)) + var/obj/item/organ/neworg = new path(src, TRUE) + neworg.name = "[name] [neworg.name]" + neworg.meat_type = meat_type + internal_organs |= neworg + internal_organs -= path + for(var/obj/item/organ/OR in internal_organs) OR.removed() internal_organs -= OR diff --git a/code/modules/mob/living/organs.dm b/code/modules/mob/living/organs.dm index d0489bcf6f..76694553f6 100644 --- a/code/modules/mob/living/organs.dm +++ b/code/modules/mob/living/organs.dm @@ -17,12 +17,21 @@ return organs_by_name[zone] /mob/living/gib() + for(var/path in internal_organs) + if(ispath(path)) + var/obj/item/organ/neworg = new path(src, TRUE) + internal_organs -= path + neworg.name = "[name] [neworg.name]" + neworg.meat_type = meat_type + internal_organs |= neworg + for(var/obj/item/organ/I in internal_organs) I.removed() if(isturf(I?.loc)) // Some organs qdel themselves or other things when removed I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) for(var/obj/item/organ/external/E in src.organs) - E.droplimb(0,DROPLIMB_EDGE,1) + if(!ispath(E)) + E.droplimb(0,DROPLIMB_EDGE,1) ..() diff --git a/code/modules/mob/living/simple_mob/simple_mob.dm b/code/modules/mob/living/simple_mob/simple_mob.dm index 4d178b4ece..6687b1f380 100644 --- a/code/modules/mob/living/simple_mob/simple_mob.dm +++ b/code/modules/mob/living/simple_mob/simple_mob.dm @@ -173,29 +173,6 @@ if(has_eye_glow) add_eyes() - if(LAZYLEN(organs)) - for(var/path in organs) - if(ispath(path)) - var/obj/item/organ/external/neworg = new path(src) - neworg.name = "[name] [neworg.name]" - neworg.meat_type = meat_type - - if(limb_icon) - neworg.force_icon = limb_icon - neworg.force_icon_key = limb_icon_key - - organs |= neworg - organs -= path - - if(LAZYLEN(internal_organs)) - for(var/path in internal_organs) - if(ispath(path)) - var/obj/item/organ/neworg = new path(src) - neworg.name = "[name] [neworg.name]" - neworg.meat_type = meat_type - internal_organs |= neworg - internal_organs -= path - return ..() /mob/living/simple_mob/Destroy() diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index c60420d359..9047eb2665 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -84,8 +84,8 @@ var/list/organ_cache = list() if(!LAZYLEN(holder.organs_by_name)) holder.organs_by_name = list() - holder.internal_organs |= src - holder.internal_organs_by_name[organ_tag] = src + holder.organs |= src + holder.organs_by_name[organ_tag] = src if(!max_damage) max_damage = min_broken_damage * 2