From 9e4948148dec9b4079a31f094d0c2fd0b8ca9b32 Mon Sep 17 00:00:00 2001 From: Sealed101 Date: Fri, 6 Oct 2023 15:30:15 +0300 Subject: [PATCH] Bad food has bad food reagent again (#78747) still on break so i didn't think too hard about this one ## About The Pull Request Prevents food interactions from clearing the resulting food's reagents if the result is a bad recipe. Blackbox logging is also iffy here, some of them log it even if the resulting food is a burned mess, some don't. It's weird! ## Why It's Good For The Game Fixes #78400
Makes one car moth happy ![no habla espanol](https://github.com/tgstation/tgstation/assets/75863639/a3f26acb-3a7c-44a6-a4de-2b67e4d56230)
Did you know the appendix has bad_food reagent in it? https://github.com/tgstation/tgstation/blob/699d09ca33e807f9100689c3ab5fbec3916186ee/code/modules/surgery/organs/internal/appendix/_appendix.dm#L5-L15 ## Changelog :cl: fix: fixed bad food not having bad food reagents /:cl: --- code/datums/components/bakeable.dm | 2 +- code/datums/components/grillable.dm | 2 +- code/datums/elements/food/microwavable.dm | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/datums/components/bakeable.dm b/code/datums/components/bakeable.dm index 537ae62ddbe..1b56a0f9bd4 100644 --- a/code/datums/components/bakeable.dm +++ b/code/datums/components/bakeable.dm @@ -67,7 +67,7 @@ var/atom/original_object = parent var/obj/item/plate/oven_tray/used_tray = original_object.loc var/atom/baked_result = new bake_result(used_tray) - if(baked_result.reagents) //make space and tranfer reagents if it has any + if(baked_result.reagents && positive_result) //make space and tranfer reagents if it has any & the resulting item isn't bad food or other bad baking result baked_result.reagents.clear_reagents() original_object.reagents.trans_to(baked_result, original_object.reagents.total_volume) diff --git a/code/datums/components/grillable.dm b/code/datums/components/grillable.dm index 26e27626abb..8458fa25e62 100644 --- a/code/datums/components/grillable.dm +++ b/code/datums/components/grillable.dm @@ -99,7 +99,7 @@ if(original_object.custom_materials) grilled_result.set_custom_materials(original_object.custom_materials) - if(IsEdible(grilled_result)) + if(IsEdible(grilled_result) && positive_result) BLACKBOX_LOG_FOOD_MADE(grilled_result.type) grilled_result.reagents.clear_reagents() original_object.reagents?.trans_to(grilled_result, original_object.reagents.total_volume) diff --git a/code/datums/elements/food/microwavable.dm b/code/datums/elements/food/microwavable.dm index 3ad3e272d34..037e3359ac7 100644 --- a/code/datums/elements/food/microwavable.dm +++ b/code/datums/elements/food/microwavable.dm @@ -41,13 +41,13 @@ var/efficiency = istype(used_microwave) ? used_microwave.efficiency : 1 SEND_SIGNAL(result, COMSIG_ITEM_MICROWAVE_COOKED, source, efficiency) - if(IS_EDIBLE(result)) - if(microwaver && microwaver.mind) - ADD_TRAIT(result, TRAIT_FOOD_CHEF_MADE, REF(microwaver.mind)) + if(IS_EDIBLE(result) && (result_typepath != default_typepath)) + BLACKBOX_LOG_FOOD_MADE(result.type) result.reagents.clear_reagents() source.reagents?.trans_to(result, source.reagents.total_volume) - BLACKBOX_LOG_FOOD_MADE(result.type) + if(microwaver && microwaver.mind) + ADD_TRAIT(result, TRAIT_FOOD_CHEF_MADE, REF(microwaver.mind)) qdel(source)