From 59ed5716efc5a78f3f2edb14f9577be150279673 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Thu, 10 Aug 2023 03:09:31 -0700 Subject: [PATCH] Fix runtime with hijack burrowed PR (#4144) # About the pull request This PR is a followup to #3592 fixing runtimes when hijack occurs because it was assumed the mob's job was a datum/job when it actually is a string. # Explain why it's good for the game Code shouldn't runtime. Fixes: ![image](https://github.com/cmss13-devs/cmss13/assets/76988376/b9f47464-07d3-4972-af6d-21dd7dffd3e9) # 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 runtimes with hijack not calculating roles correctly for hijack larva surge /:cl: --- .../mob/living/carbon/xenomorph/xeno_defines.dm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm index 512c26f8c360..8a1f0ce00f3b 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm @@ -930,10 +930,14 @@ embryo.hivenumber = XENO_HIVE_FORSAKEN potential_host.update_med_icon() for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) - if((isspecieshuman(current_human) || isspeciessynth(current_human)) && current_human.job) - var/turf/turf = get_turf(current_human) - if(is_mainship_level(turf?.z)) - shipside_humans_weighted_count += RoleAuthority.calculate_role_weight(current_human.job) + if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) + continue + var/datum/job/job = RoleAuthority.roles_for_mode[current_human.job] + if(!job) + continue + var/turf/turf = get_turf(current_human) + if(is_mainship_level(turf?.z)) + shipside_humans_weighted_count += RoleAuthority.calculate_role_weight(job) hijack_burrowed_surge = TRUE hijack_burrowed_left = max(n_ceil(shipside_humans_weighted_count * 0.5) - xenos_count, 5) hivecore_cooldown = FALSE