From 7f015657cc21421af9ddc0289544dc2bdd8a8c85 Mon Sep 17 00:00:00 2001 From: Krysonism <49783092+Krysonism@users.noreply.github.com> Date: Wed, 9 Apr 2025 03:58:03 +0200 Subject: [PATCH] Fixes vat grower bubble overlay not clearing. (#90183) ## About The Pull Request This PR fixes the vat grower bubble overlay not clearing when the sample grows to completion. Now the vat is in charge of deleteing the sample which seems more reasonable, instead of the cell line deleting its parent sample. ## Why It's Good For The Game Bubbles are supposed to be the visual queue a sample is loaded into the vat, no more ghost bubbles. ## Changelog :cl: fix: fixed the vat grower bubble overlay not clearing upon completetion. /:cl: --- code/__DEFINES/dcs/signals/signals_cytology.dm | 2 +- .../vatgrowing/samples/_micro_organism.dm | 15 +++++---------- .../vatgrowing/samples/cell_lines/common.dm | 7 +------ .../research/xenobiology/vatgrowing/vatgrower.dm | 6 ++++-- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_cytology.dm b/code/__DEFINES/dcs/signals/signals_cytology.dm index 7dc4152edfc..70fbe29c4e0 100644 --- a/code/__DEFINES/dcs/signals/signals_cytology.dm +++ b/code/__DEFINES/dcs/signals/signals_cytology.dm @@ -1,4 +1,4 @@ //Cytology signals ///Sent from /datum/biological_sample/proc/reset_sample #define COMSIG_SAMPLE_GROWTH_COMPLETED "sample_growth_completed" - #define SPARE_SAMPLE (1<<0) + diff --git a/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm b/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm index d7cf6c9c22c..1de9c21fe19 100644 --- a/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm +++ b/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm @@ -85,18 +85,16 @@ playsound(vat, 'sound/effects/splat.ogg', 50, TRUE) if(rand(1, 100) < risk) //Fail roll! fuck_up_growing(vat) - - return FALSE - succeed_growing(vat) - return TRUE + . = FALSE + else + succeed_growing(vat) + . = TRUE + SEND_SIGNAL(vat.biological_sample, COMSIG_SAMPLE_GROWTH_COMPLETED) /datum/micro_organism/cell_line/proc/fuck_up_growing(obj/machinery/vatgrower/vat) vat.visible_message(span_warning("The biological sample in [vat] seems to have dissipated!")) if(prob(50)) new /obj/effect/gibspawner/generic(get_turf(vat)) //Spawn some gibs. - if(SEND_SIGNAL(vat.biological_sample, COMSIG_SAMPLE_GROWTH_COMPLETED) & SPARE_SAMPLE) - return - QDEL_NULL(vat.biological_sample) /datum/micro_organism/cell_line/proc/succeed_growing(obj/machinery/vatgrower/vat) var/datum/effect_system/fluid_spread/smoke/smoke = new @@ -109,9 +107,6 @@ //We maybe add some color. the chance is static for now, but idewally we would be able to manipulate it in the future. if(prob(CYTO_SHINY_CHANCE)) mutate_color(thing) - if(SEND_SIGNAL(vat.biological_sample, COMSIG_SAMPLE_GROWTH_COMPLETED) & SPARE_SAMPLE) - return - QDEL_NULL(vat.biological_sample) ///Overriden to show more info like needs, supplementary and supressive reagents and also growth. /datum/micro_organism/cell_line/get_details(show_details) diff --git a/code/modules/research/xenobiology/vatgrowing/samples/cell_lines/common.dm b/code/modules/research/xenobiology/vatgrowing/samples/cell_lines/common.dm index 44721aa6c38..590cddf055d 100644 --- a/code/modules/research/xenobiology/vatgrowing/samples/cell_lines/common.dm +++ b/code/modules/research/xenobiology/vatgrowing/samples/cell_lines/common.dm @@ -486,9 +486,6 @@ var/mob/selected_mob = pick(list(/mob/living/basic/clown/mutant/slow, /mob/living/basic/clown/fleshclown)) new selected_mob(get_turf(vat)) - if(SEND_SIGNAL(vat.biological_sample, COMSIG_SAMPLE_GROWTH_COMPLETED) & SPARE_SAMPLE) - return - QDEL_NULL(vat.biological_sample) /datum/micro_organism/cell_line/clown/bananaclown desc = "Clown bits with banana chunks" @@ -660,9 +657,7 @@ vat.visible_message(span_warning("You hear angry buzzing coming from the inside of the vat!")) for(var/i in 1 to 5) new /mob/living/basic/bee(get_turf(vat)) - if(SEND_SIGNAL(vat.biological_sample, COMSIG_SAMPLE_GROWTH_COMPLETED) & SPARE_SAMPLE) - return - QDEL_NULL(vat.biological_sample) + /datum/micro_organism/cell_line/butterfly desc = "Papilionoidea cells" diff --git a/code/modules/research/xenobiology/vatgrowing/vatgrower.dm b/code/modules/research/xenobiology/vatgrowing/vatgrower.dm index 1ab0be77d65..621f72f61f0 100644 --- a/code/modules/research/xenobiology/vatgrowing/vatgrower.dm +++ b/code/modules/research/xenobiology/vatgrowing/vatgrower.dm @@ -169,5 +169,7 @@ if(resampler_active) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound), get_turf(src), 'sound/effects/servostep.ogg', 100, 1), 1.5 SECONDS) biological_sample.reset_sample() - return SPARE_SAMPLE - UnregisterSignal(biological_sample, COMSIG_SAMPLE_GROWTH_COMPLETED) + else + UnregisterSignal(biological_sample, COMSIG_SAMPLE_GROWTH_COMPLETED) + QDEL_NULL(biological_sample) + update_appearance()