Fix issue with cooking recipes requiring reagents (#30611)

* Fix issue with cooking recipes requiring reagents

* don't spam debug messages with autochef

* reagent step processing, other fuckery

* fix lint

* properly clean up tracked recipes
This commit is contained in:
warriorstar-orion
2026-02-17 17:54:04 +00:00
committed by GitHub
parent 87a1e11667
commit 523c09bab9
5 changed files with 78 additions and 62 deletions
@@ -35,6 +35,7 @@ RESTRICT_TYPE(/datum/cooking/recipe_step)
/// Special function to check if the step has been satisfied. Sometimes just
/// following the step is enough, but not always.
/datum/cooking/recipe_step/proc/is_complete(obj/added_item, datum/cooking/recipe_tracker/tracker, list/step_data)
SHOULD_BE_PURE(TRUE)
return TRUE
/// Return a human readable description of the recipe step as an instruction to the reader.
@@ -79,12 +79,12 @@ RESTRICT_TYPE(/datum/cooking/recipe_step/add_reagent)
/datum/cooking/recipe_step/add_reagent/follow_step(obj/used_item, datum/cooking/recipe_tracker/tracker)
var/obj/item/reagent_containers/our_item = used_item
if(!istype(our_item))
return list()
return
var/obj/item/container = locateUID(tracker.container_uid)
var/trans = our_item.reagents.trans_to(container, our_item.amount_per_transfer_from_this)
return list(message = "You transfer [trans] units to \the [container].")
return list("message" = "You transfer [trans] units to \the [container].", "amount" = amount, "reagent_remain_percent" = remain_percent, "reagent_id" = reagent_id)
/datum/cooking/recipe_step/add_reagent/is_complete(obj/used_item, datum/cooking/recipe_tracker/tracker, list/step_data)
var/obj/item/container = locateUID(tracker.container_uid)
@@ -14,16 +14,18 @@
return
/datum/cooking/recipe_step/use_machine/check_conditions_met(obj/used_item, datum/cooking/recipe_tracker/tracker)
var/obj/item/reagent_containers/cooking/container = locateUID(tracker.container_uid)
if(container.get_cooker_time(cooker_surface_name, temperature) >= time)
return PCWJ_CHECK_VALID
if(istype(used_item, machine_type))
return PCWJ_CHECK_SILENT
return PCWJ_CHECK_INVALID
/datum/cooking/recipe_step/use_machine/is_complete(obj/added_item, datum/cooking/recipe_tracker/tracker, list/step_data)
var/obj/item/reagent_containers/cooking/container = locateUID(tracker.container_uid)
if(istype(container) && container.get_cooker_time(cooker_surface_name, temperature) >= time)
return TRUE
return FALSE
/datum/cooking/recipe_step/use_machine/follow_step(obj/used_item, datum/cooking/recipe_tracker/tracker, mob/user)
var/list/step_data = list(target = used_item.UID())
var/obj/item/reagent_containers/cooking/container = locateUID(tracker.container_uid)