From 1aa91b33ac960e4e739b58dc3ffaec40bbd054fa Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Tue, 28 Nov 2023 18:25:55 +0000 Subject: [PATCH] removes egg from carrier if it no longer exists --- .../carbon/xenomorph/mutators/strains/carrier/eggsac.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm index 3d032da2fe36..866a186045a5 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm @@ -63,9 +63,12 @@ /datum/behavior_delegate/carrier_eggsac/on_life() if(length(eggs_sustained) > egg_sustain_cap) var/obj/effect/alien/egg/carrier_egg/my_egg = eggs_sustained[1] - remove_egg_owner(my_egg) - my_egg.start_unstoppable_decay() - to_chat(bound_xeno, SPAN_XENOWARNING("You can only sustain [egg_sustain_cap] eggs off hive weeds! Your oldest placed egg is decaying rapidly.")) + if(my_egg) + remove_egg_owner(my_egg) + my_egg.start_unstoppable_decay() + to_chat(bound_xeno, SPAN_XENOWARNING("You can only sustain [egg_sustain_cap] eggs off hive weeds! Your oldest placed egg is decaying rapidly.")) + else + eggs_sustained -= my_egg for(var/obj/effect/alien/egg/carrier_egg/my_egg as anything in eggs_sustained) //Get the distance from us to our sustained egg