Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buried larva spawn grace period at start of round #4988

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading