From a987ced403a2b966ea22acafe8a4a472eb6553a5 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Sat, 24 Jun 2023 01:47:09 -0700 Subject: [PATCH] I don't want to hear about some chad facehugger getting all the marines --- code/_globalvars/lists/mobs.dm | 1 + code/modules/mob/living/carbon/xenomorph/Embryo.dm | 6 ++++++ code/modules/mob/living/carbon/xenomorph/Facehuggers.dm | 1 + 3 files changed, 8 insertions(+) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index 187f179094b2..e2203aadce0c 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -23,6 +23,7 @@ GLOBAL_LIST_EMPTY_TYPED(alive_human_list, /mob/living/carbon/human) // list of a GLOBAL_LIST_EMPTY_TYPED(xeno_mob_list, /mob/living/carbon/xenomorph) GLOBAL_LIST_EMPTY_TYPED(living_xeno_list, /mob/living/carbon/xenomorph) GLOBAL_LIST_EMPTY_TYPED(xeno_cultists, /mob/living/carbon/human) +GLOBAL_LIST_EMPTY_TYPED(player_embryo_list, /obj/item/alien_embryo) GLOBAL_LIST_EMPTY_TYPED(hellhound_list, /mob/living/carbon/xenomorph/hellhound) GLOBAL_LIST_EMPTY_TYPED(zombie_list, /mob/living/carbon/human) diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index c8bcc6ffa4bb..29779480f143 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -35,6 +35,7 @@ C.med_hud_set_status() STOP_PROCESSING(SSobj, src) affected_mob = null + GLOB.player_embryo_list -= src . = ..() /obj/item/alien_embryo/process() @@ -164,6 +165,11 @@ picked = cur_obs candidates -= cur_obs message_alien_candidates(candidates, dequeued = 0) + for(var/obj/item/alien_embryo/embryo as anything in GLOB.player_embryo_list) + if(embryo.hugger_ckey == cur_obs.ckey && embryo != src) + // Skipping src just in case an admin wants to quickly check before this thing fully deletes + // If this nulls out any embryo, wow + embryo.hugger_ckey = null break if(!picked) diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm index b0037b7c575e..212688c8c98f 100644 --- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm @@ -296,6 +296,7 @@ var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(target) embryo.hivenumber = hivenumber embryo.hugger_ckey = hugger_ckey + GLOB.player_embryo_list += embryo embryo.flags_embryo = flags_embryo flags_embryo = NO_FLAGS