From bcbe219973f9db42c1d72e3d07aa438c06e5f570 Mon Sep 17 00:00:00 2001 From: tattle <66640614+dragomagol@users.noreply.github.com> Date: Wed, 30 Nov 2022 21:26:25 -0800 Subject: [PATCH] Add baking and grilling results to the blackbox (#71632) ## About The Pull Request Adds baking and grilling results to the blackbox. Microwaved and crafted foods were being logged here, but the logging messages were lost when we got the grilling and baking components. ## Why It's Good For The Game More food logging yeehaw ## Changelog No player-facing changes Co-authored-by: tattle --- code/__DEFINES/food.dm | 2 ++ code/datums/components/bakeable.dm | 2 +- code/datums/components/grillable.dm | 4 +++- code/datums/elements/food/microwavable.dm | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/food.dm b/code/__DEFINES/food.dm index fc3ae5d81c6..2aae58d42cf 100644 --- a/code/__DEFINES/food.dm +++ b/code/__DEFINES/food.dm @@ -174,3 +174,5 @@ DEFINE_BITFIELD(food_flags, list( #define DEFAULT_MAX_ICE_CREAM_SCOOPS 3 // the vertical distance in pixels from an ice cream scoop and another. #define ICE_CREAM_SCOOP_OFFSET 4 + +#define BLACKBOX_LOG_FOOD_MADE(food) SSblackbox.record_feedback("tally", "food_made", 1, food) diff --git a/code/datums/components/bakeable.dm b/code/datums/components/bakeable.dm index d33586f4625..73a9cb308da 100644 --- a/code/datums/components/bakeable.dm +++ b/code/datums/components/bakeable.dm @@ -64,7 +64,6 @@ ///Ran when an object finished baking /datum/component/bakeable/proc/finish_baking(atom/used_oven) - 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) @@ -81,6 +80,7 @@ if(positive_result) used_oven.visible_message(span_notice("You smell something great coming from [used_oven]."), blind_message = span_notice("You smell something great...")) + BLACKBOX_LOG_FOOD_MADE(baked_result.type) else used_oven.visible_message(span_warning("You smell a burnt smell coming from [used_oven]."), blind_message = span_warning("You smell a burnt smell...")) SEND_SIGNAL(parent, COMSIG_ITEM_BAKED, baked_result) diff --git a/code/datums/components/grillable.dm b/code/datums/components/grillable.dm index 99cadaaa20d..7ea1eed1f2e 100644 --- a/code/datums/components/grillable.dm +++ b/code/datums/components/grillable.dm @@ -69,7 +69,6 @@ ///Ran when an object finished grilling /datum/component/grillable/proc/finish_grilling(atom/grill_source) - var/atom/original_object = parent var/atom/grilled_result @@ -82,6 +81,9 @@ if(original_object.custom_materials) grilled_result.set_custom_materials(original_object.custom_materials) + if(IS_EDIBLE(grilled_result)) + BLACKBOX_LOG_FOOD_MADE(grilled_result.type) + SEND_SIGNAL(parent, COMSIG_ITEM_GRILLED, grilled_result) if(who_placed_us) ADD_TRAIT(grilled_result, TRAIT_FOOD_CHEF_MADE, who_placed_us) diff --git a/code/datums/elements/food/microwavable.dm b/code/datums/elements/food/microwavable.dm index 39702b6745d..a923e498bb7 100644 --- a/code/datums/elements/food/microwavable.dm +++ b/code/datums/elements/food/microwavable.dm @@ -49,7 +49,7 @@ result.reagents?.multiply_reagents(efficiency * CRAFTED_FOOD_BASE_REAGENT_MODIFIER) source.reagents?.trans_to(result, source.reagents.total_volume) - SSblackbox.record_feedback("tally", "food_made", 1, result.type) + BLACKBOX_LOG_FOOD_MADE(result.type) qdel(source)