diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 389fc10df4d94..7d0259895424a 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -296,7 +296,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) if(!. || can_reenter_corpse || aghosting) return var/mob/ghost = . - if(tier != XENO_TIER_MINION) + if(tier != XENO_TIER_MINION && hivenumber == XENO_HIVE_NORMAL) GLOB.key_to_time_of_xeno_death[ghost.key] = world.time //If you ghost as a xeno that is not a minion, sets respawn timer diff --git a/code/modules/mob/living/carbon/xenomorph/hive_datum.dm b/code/modules/mob/living/carbon/xenomorph/hive_datum.dm index 76832df017192..8afbf6cb9aa20 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_datum.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_datum.dm @@ -933,16 +933,6 @@ to_chat will check for valid clients itself already so no need to double check f if((xeno_job.total_positions - xeno_job.current_positions) < 0) return FALSE - if(XENODEATHTIME_CHECK(xeno_candidate)) - if(!check_other_rights(xeno_candidate.client, R_ADMIN, FALSE)) - XENODEATHTIME_MESSAGE(xeno_candidate) - return FALSE - if(tgui_alert(xeno_candidate, "You wouldn't normally qualify for this respawn. Are you sure you want to bypass it with your admin powers?", "Bypass Respawn", list("Yes", "No")) != "Yes") - XENODEATHTIME_MESSAGE(xeno_candidate) - return FALSE - log_admin("[key_name(xeno_candidate)] used his admin power to bypass respawn before his timer was over") - message_admins("[key_name(xeno_candidate)] used his admin power to bypass respawn before his timer was over") - var/list/possible_mothers = list() var/list/possible_silos = list() SEND_SIGNAL(src, COMSIG_HIVE_XENO_MOTHER_PRE_CHECK, possible_mothers, possible_silos) //List variable passed by reference, and hopefully populated. @@ -1096,7 +1086,7 @@ to_chat will check for valid clients itself already so no need to double check f var/list/possible_mothers = list() var/list/possible_silos = list() SEND_SIGNAL(src, COMSIG_HIVE_XENO_MOTHER_PRE_CHECK, possible_mothers, possible_silos) - if(stored_larva > 0 && !LAZYLEN(candidate) && (length(possible_mothers) || length(possible_silos) || (SSticker.mode?.flags_round_type & MODE_SILO_RESPAWN && SSmonitor.gamestate == SHUTTERS_CLOSED))) + if(stored_larva > 0 && !LAZYLEN(candidate) && !XENODEATHTIME_CHECK(observer) && (length(possible_mothers) || length(possible_silos) || (SSticker.mode?.flags_round_type & MODE_SILO_RESPAWN && SSmonitor.gamestate == SHUTTERS_CLOSED))) attempt_to_spawn_larva(observer) return if(LAZYFIND(candidate, observer)) @@ -1105,7 +1095,8 @@ to_chat will check for valid clients itself already so no need to double check f LAZYADD(candidate, observer) RegisterSignal(observer, COMSIG_QDELETING, PROC_REF(clean_observer)) observer.larva_position = LAZYLEN(candidate) - to_chat(observer, span_warning("There are no burrowed Larvae or no silos. You are in position [observer.larva_position] to become a Xenomorph.")) + to_chat(observer, span_warning("There are either no burrowed larva, you are on your xeno respawn timer, or there are no silos. You are in position [observer.larva_position] to become a Xenomorph.")) + give_larva_to_next_in_queue() //Updates the queue for xeno respawn timer return TRUE /// Remove an observer from the larva candidate queue @@ -1137,14 +1128,20 @@ to_chat will check for valid clients itself already so no need to double check f if(!xeno_job.occupy_job_positions(slot_occupied)) return var/mob/dead/observer/observer_in_queue + var/oldest_death = 0 while(stored_larva > 0 && LAZYLEN(candidate)) for(var/i in 1 to LAZYLEN(candidate)) observer_in_queue = LAZYACCESS(candidate, i) if(!XENODEATHTIME_CHECK(observer_in_queue)) break + var/candidate_death_time = (GLOB.key_to_time_of_xeno_death[observer_in_queue.key] + SSticker.mode?.xenorespawn_time) - world.time + if(oldest_death > candidate_death_time || !oldest_death) + oldest_death = candidate_death_time observer_in_queue = null //Deathtimer still running if(!observer_in_queue) //No valid candidates in the queue + if(oldest_death) + addtimer(CALLBACK(src, PROC_REF(give_larva_to_next_in_queue)), oldest_death + 1 SECONDS) //Will update the queue once timer is up, spawning them in if there is a burrowed break LAZYREMOVE(candidate, observer_in_queue)