From fa3745bf4137a5747a9ec399b4fd284fcca01ba7 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:31:39 -0800 Subject: [PATCH] Fix buried larva spawn grace period at start of round (#4988) # About the pull request Looking at the code again, #4502 is unintentionally eliminating the buried larva grace period when there is no core. The first 30 minutes should have a core be optional (because the hive is still being established), but the queue requires a core (or nested bodies) to dequeue players from the queue. So as soon as there is one player in queue, buried spawns during the no-core grace period would be stopped. This PR makes it so the queue will only prevent manual buried spawns when there is a core. # Explain why it's good for the game Fixes a situation that needlessly hinders xeno start if the hive puts off creating a core. Also the logic was getting fairly complex here so the early returns should make it more manageable. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: Drathek fix: Fixed buried larva spawn grace period at start of round if there is a queue: Now join as xeno when there's a queue will only prevent buried larva spawns if there is no core. /:cl: --- code/game/gamemodes/cm_initialize.dm | 36 ++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 17a255009089..519ce4ed4f6f 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -356,21 +356,27 @@ Additional game mode variables. else available_xenos_non_ssd += cur_xeno - // Only offer buried larva if there is no queue: - // This basically means this block of code will almost never execute, because we are instead relying on the hive cores/larva pops to handle their larva - // Technically this should be after a get_alien_candidates() call to be accurate, but we are intentionally trying to not call that proc as much as possible - if(GLOB.xeno_queue_candidate_count < 1) - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!hive.hardcore && hive.stored_larva && (hive.hive_location || (world.time < XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time))) - if(SSticker.mode && (SSticker.mode.flags_round_type & MODE_RANDOM_HIVE)) - available_xenos |= "any buried larva" - LAZYADD(available_xenos["any buried larva"], hive) - else - var/larva_option = "buried larva ([hive])" - available_xenos += larva_option - available_xenos[larva_option] = list(hive) + var/datum/hive_status/hive + for(var/hivenumber in GLOB.hive_datum) + hive = GLOB.hive_datum[hivenumber] + if(hive.hardcore) + continue + if(!hive.stored_larva) + continue + // Only offer buried larva if there is no queue because we are instead relying on the hive cores/larva pops to handle their larva: + // Technically this should be after a get_alien_candidates() call to be accurate, but we are intentionally trying to not call that proc as much as possible + if(hive.hive_location && GLOB.xeno_queue_candidate_count > 0) + continue + if(!hive.hive_location && (world.time > XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time)) + continue + + if(SSticker.mode && (SSticker.mode.flags_round_type & MODE_RANDOM_HIVE)) + available_xenos |= "any buried larva" + LAZYADD(available_xenos["any buried larva"], hive) + else + var/larva_option = "buried larva ([hive])" + available_xenos += larva_option + available_xenos[larva_option] = list(hive) if(!available_xenos.len || (instant_join && !available_xenos_non_ssd.len)) if(!xeno_candidate.client || !xeno_candidate.client.prefs || !(xeno_candidate.client.prefs.be_special & BE_ALIEN_AFTER_DEATH))