From edccfb30d4548ec776e697c47d55979e74a41f46 Mon Sep 17 00:00:00 2001 From: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Date: Sat, 15 Nov 2025 23:53:38 +0100 Subject: [PATCH] Fixes admin-spawned vines not having selected mutations (#93948) ## About The Pull Request Closes #93931 ## Changelog :cl: fix: Fixed admin-spawned vines not having selected mutations /:cl: --- code/modules/events/space_vines/vine_event.dm | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/code/modules/events/space_vines/vine_event.dm b/code/modules/events/space_vines/vine_event.dm index 104dd39601e..fbd3b5015a9 100644 --- a/code/modules/events/space_vines/vine_event.dm +++ b/code/modules/events/space_vines/vine_event.dm @@ -52,20 +52,25 @@ final_turf_candidates += floor qdel(vine) - if(length(final_turf_candidates)) //Pick a turf to spawn at if we can - var/turf/floor = pick(final_turf_candidates) - var/list/selected_mutations = list() + if(!length(final_turf_candidates)) + return - if(mutations_overridden == FALSE) - selected_mutations = list(pick(subtypesof(/datum/spacevine_mutation))) - else - selected_mutations = override_mutations - if(isnull(potency)) - potency = rand(50,100) - if(isnull(production)) - production = rand(1, 4) + // Pick a turf to spawn at if we can + var/turf/floor = pick(final_turf_candidates) + var/list/selected_mutations = list() - new /datum/spacevine_controller(floor, selected_mutations, potency, production, src) //spawn a controller at turf with randomized stats and a single random mutation + if(mutations_overridden) + selected_mutations = override_mutations + else + selected_mutations = list(pick(valid_subtypesof(/datum/spacevine_mutation))) + + if(isnull(potency)) + potency = rand(50, 100) + + if(isnull(production)) + production = rand(1, 4) + + new /datum/spacevine_controller(floor, selected_mutations, potency, production, src) //spawn a controller at turf with randomized stats and a single random mutation /datum/event_admin_setup/set_location/spacevine input_text = "Spawn vines at current location?" @@ -83,17 +88,17 @@ if("Custom") return ..() if("Random") - choices = list("[pick(subtypesof(/datum/spacevine_mutation))]") + choices = list("[pick(valid_subtypesof(/datum/spacevine_mutation))]") else return ADMIN_CANCEL_EVENT /datum/event_admin_setup/multiple_choice/spacevine/get_options() - return subtypesof(/datum/spacevine_mutation/) + return valid_subtypesof(/datum/spacevine_mutation) /datum/event_admin_setup/multiple_choice/spacevine/apply_to_event(datum/round_event/spacevine/event) var/list/type_choices = list() - for(var/choice in choices) - type_choices += text2path(choice) + for(var/list/choice in choices) + type_choices += text2path(choice[1]) event.mutations_overridden = TRUE event.override_mutations = type_choices