From 409506bcc39a1e9ea163ddfbbc324d3fce7a601c Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 8 Jan 2021 18:43:06 +0100 Subject: [PATCH] [MIRROR] Fix Botany chemical gene grafts (#2566) * Fix chemical grafts (#56000) Fixes chemical grafts in botany so their seeds actually gain the reagents they offer. For those who didn't know, Spaceman's Trumpet is the only plant (for now) that allows you you graft it and get a chemical instead of a trait (Polypyrylium Oligomers). Only this graft doesn't work. It shows up in the plant, but on harvest there is none of that chemical inside of it. Now it works. * Fix Botany chemical gene grafts Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- code/modules/hydroponics/grafts.dm | 2 +- code/modules/hydroponics/seeds.dm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/hydroponics/grafts.dm b/code/modules/hydroponics/grafts.dm index e1c9a6677d4..e5e4ddd3e0a 100644 --- a/code/modules/hydroponics/grafts.dm +++ b/code/modules/hydroponics/grafts.dm @@ -11,7 +11,7 @@ attack_verb_continuous = list("plants", "vegitizes", "crops", "reaps", "farms") attack_verb_simple = list("plant", "vegitize", "crop", "reap", "farm") ///The stored trait taken from the parent plant. Defaults to perenial growth. - var/datum/plant_gene/trait/stored_trait + var/datum/plant_gene/stored_trait ///Determines the appearance of the graft. Rudimentary right now so it just picks randomly. var/graft_appearance ///Seed that the graft was taken from, used for applying parent stats. Can be unexpectedly nulled by the parent plant getting deleted. diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 4f333d171d8..fa8c658656a 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -634,7 +634,7 @@ * - [snip][/obj/item/graft]: The graft being used applied to this plant. */ /obj/item/seeds/proc/apply_graft(obj/item/graft/snip) - var/datum/plant_gene/trait/new_trait = snip.stored_trait + var/datum/plant_gene/new_trait = snip.stored_trait if(new_trait?.can_add(src)) genes += new_trait.Copy() @@ -646,4 +646,7 @@ src.weed_chance = round(clamp(max(src.weed_chance, (src.weed_chance+(2/3)*(snip.weed_chance-src.weed_chance) )),0,100)) src.yield = round(clamp(max(src.yield, (src.yield +(2/3)*(snip.yield -src.yield) )),0,10 )) + // Add in any reagents, too. + reagents_from_genes() + return TRUE