diff --git a/GainStation13/code/mechanics/transformation/food.dm b/GainStation13/code/mechanics/transformation/food.dm index a84dae4f94..c77b22faac 100644 --- a/GainStation13/code/mechanics/transformation/food.dm +++ b/GainStation13/code/mechanics/transformation/food.dm @@ -4,12 +4,12 @@ return FALSE var/mob/living/food_mob = transformation_component.transformed_mob - if(!istype(food_mob) || !(food_mob?.vore_flags & DEVOURABLE) || (eater?.vore_flags & NO_VORE) || !istype(eater.vore_selected)) + var/obj/belly/vore_belly = eater?.vore_selected + if(!istype(food_mob) || !(food_mob?.vore_flags & DEVOURABLE) || (eater?.vore_flags & NO_VORE) || !istype(vore_belly)) return FALSE qdel(transformation_component) - var/obj/belly/vore_belly = eater.vore_selected - if(!vore_belly.nom_mob(food_mob,eater)) + if(!vore_belly?.nom_mob(food_mob,eater)) return FALSE return TRUE diff --git a/GainStation13/code/mechanics/transformation/transformation_component.dm b/GainStation13/code/mechanics/transformation/transformation_component.dm index 46dbc3087e..5955ddd7cc 100644 --- a/GainStation13/code/mechanics/transformation/transformation_component.dm +++ b/GainStation13/code/mechanics/transformation/transformation_component.dm @@ -21,13 +21,17 @@ var/able_to_struggle_out = TRUE /// Transfer to vore belly when eaten var/transfer_to_vore = TRUE + /// Has the mob already been removed? + var/mob_removed = FALSE /datum/component/transformation_item/Initialize() RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(examine)) - RegisterSignal(parent, COMSIG_PARENT_QDELETING, PROC_REF(remove_mob)) + RegisterSignal(parent, COMSIG_PARENT_PREQDELETED, PROC_REF(remove_mob)) /datum/component/transformation_item/Destroy(force, silent) - remove_mob() + if(!mob_removed) + remove_mob() + return ..() /datum/component/transformation_item/proc/examine(datum/source, mob/user, list/examine_list) @@ -107,3 +111,5 @@ if(scale_object) parent_atom.transform = null + mob_removed = TRUE + qdel(src)